diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index 30c6603a5..ff3c2aa9c 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -658,7 +658,7 @@ namespace attribute { attribute_t *create_on_off(cluster_t *cluster, bool value) { - return esp_matter::attribute::create(cluster, OnOff::Attributes::OnOff::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, OnOff::Attributes::OnOff::Id, ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_bool(value)); } @@ -682,8 +682,8 @@ attribute_t *create_off_wait_time(cluster_t *cluster, uint16_t value) attribute_t *create_start_up_on_off(cluster_t *cluster, uint8_t value) { - return esp_matter::attribute::create(cluster, OnOff::Attributes::StartUpOnOff::Id, ATTRIBUTE_FLAG_WRITABLE, - esp_matter_enum8(value)); + return esp_matter::attribute::create(cluster, OnOff::Attributes::StartUpOnOff::Id, + ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_enum8(value)); } } /* attribute */ diff --git a/components/esp_matter/esp_matter_core.cpp b/components/esp_matter/esp_matter_core.cpp index 7b7d9c114..29462c086 100644 --- a/components/esp_matter/esp_matter_core.cpp +++ b/components/esp_matter/esp_matter_core.cpp @@ -1045,6 +1045,8 @@ esp_err_t store_val_in_nvs(attribute_t *attribute) if (err != ESP_OK) { return err; } + ESP_LOGI(TAG, "strore attribute in nvs: endpoint_id-0x%x, cluster_id-0x%x, attribute_id-0x%x", + endpoint_id, cluster_id, attribute_id); if (current_attribute->val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING || current_attribute->val.type == ESP_MATTER_VAL_TYPE_OCTET_STRING || current_attribute->val.type == ESP_MATTER_VAL_TYPE_ARRAY) { @@ -1085,6 +1087,8 @@ esp_err_t get_val_from_nvs(attribute_t *attribute, esp_matter_attr_val_t *val) if (err != ESP_OK) { return err; } + ESP_LOGI(TAG, "read attribute from nvs: endpoint_id-0x%x, cluster_id-0x%x, attribute_id-0x%x", + endpoint_id, cluster_id, attribute_id); if (current_attribute->val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING || current_attribute->val.type == ESP_MATTER_VAL_TYPE_OCTET_STRING || current_attribute->val.type == ESP_MATTER_VAL_TYPE_ARRAY) { diff --git a/components/esp_matter/esp_matter_feature.cpp b/components/esp_matter/esp_matter_feature.cpp index 059f3f787..18c1c88ac 100644 --- a/components/esp_matter/esp_matter_feature.cpp +++ b/components/esp_matter/esp_matter_feature.cpp @@ -60,7 +60,7 @@ namespace lighting { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::OnOff::OnOffFeature::kLighting; + return (uint32_t)OnOff::OnOffFeature::kLighting; } esp_err_t add(cluster_t *cluster, config_t *config) @@ -95,7 +95,7 @@ namespace on_off { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::LevelControl::LevelControlFeature::kOnOff; + return (uint32_t)LevelControl::LevelControlFeature::kOnOff; } esp_err_t add(cluster_t *cluster) @@ -115,7 +115,7 @@ namespace lighting { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::LevelControl::LevelControlFeature::kLighting; + return (uint32_t)LevelControl::LevelControlFeature::kLighting; } esp_err_t add(cluster_t *cluster, config_t *config) @@ -145,7 +145,7 @@ namespace hue_saturation { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::ColorControl::ColorCapabilities::kHueSaturationSupported; + return (uint32_t)ColorControl::ColorCapabilities::kHueSaturationSupported; } esp_err_t add(cluster_t *cluster, config_t *config) @@ -179,7 +179,7 @@ namespace color_temperature { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::ColorControl::ColorCapabilities::kColorTemperatureSupported; + return (uint32_t)ColorControl::ColorCapabilities::kColorTemperatureSupported; } esp_err_t add(cluster_t *cluster, config_t *config) @@ -212,7 +212,7 @@ namespace xy { uint32_t get_id() { - return (uint32_t)chip::app::Clusters::ColorControl::ColorCapabilities::kXYAttributesSupported; + return (uint32_t)ColorControl::ColorCapabilities::kXYAttributesSupported; } esp_err_t add(cluster_t *cluster, config_t *config)