diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp index 824df9835646f1..2e2ddf680a0a04 100644 --- a/src/app/util/attribute-storage.cpp +++ b/src/app/util/attribute-storage.cpp @@ -928,6 +928,10 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable) { emAfEndpoints[index].bitmask.Set(EmberAfEndpointOptions::isEnabled); } + else + { + emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled); + } #if defined(EZSP_HOST) ezspSetEndpointFlags(endpoint, (enable ? EZSP_ENDPOINT_ENABLED : EZSP_ENDPOINT_DISABLED)); @@ -963,11 +967,6 @@ bool emberAfEndpointEnableDisable(EndpointId endpoint, bool enable) app::Clusters::Descriptor::Attributes::PartsList::Id); } - if (!enable) - { - emAfEndpoints[index].bitmask.Clear(EmberAfEndpointOptions::isEnabled); - } - return true; }