diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 5239bc97e3b9c7..fe5b0dc71715b9 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -243,24 +243,19 @@ CHIP_ERROR ConfigurationManagerImpl::GetLocationCapability(uint8_t & location) CHIP_ERROR ConfigurationManagerImpl::GetDeviceTypeId(uint32_t & deviceType) { -#if CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE uint32_t value = 0; CHIP_ERROR err = ReadConfigValue(ESP32Config::kConfigKey_PrimaryDeviceType, value); - if (err == CHIP_NO_ERROR) + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { - deviceType = value; + deviceType = CHIP_DEVICE_CONFIG_DEVICE_TYPE; } else { - deviceType = CHIP_DEVICE_CONFIG_DEVICE_TYPE; + deviceType = value; } - return err; -#else - deviceType = 0; return CHIP_NO_ERROR; -#endif // CONFIG_ENABLE_ESP32_LOCATIONCAPABILITY } CHIP_ERROR ConfigurationManagerImpl::StoreCountryCode(const char * code, size_t codeLen)