diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 824df9835646f1..ce37246c4b3d9f 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -943,6 +943,7 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable) else { shutdownEndpoint(&(emAfEndpoints[index])); + emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled); } EndpointId parentEndpointId = emberAfParentEndpointFromIndex(index); @@ -963,11 +964,6 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable) app::Clusters::Descriptor::Attributes::PartsList::Id); } - if (!enable) - { - emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled); - } - return true; }