From 94db7a418aa0b8bd8c19facb92904d0102eb96e0 Mon Sep 17 00:00:00 2001 From: liyashuai Date: Tue, 8 Oct 2024 19:26:33 +0800 Subject: [PATCH] components/esp-matter: remove scene management cluster, change color temperature min value --- components/esp_matter/esp_matter_command.cpp | 1 - components/esp_matter/esp_matter_endpoint.cpp | 11 ----------- components/esp_matter/esp_matter_endpoint.h | 8 ++++++-- components/esp_matter/esp_matter_feature.h | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/components/esp_matter/esp_matter_command.cpp b/components/esp_matter/esp_matter_command.cpp index 49f5ab391..31547d910 100644 --- a/components/esp_matter/esp_matter_command.cpp +++ b/components/esp_matter/esp_matter_command.cpp @@ -2053,7 +2053,6 @@ command_t *create_stay_active_request(cluster_t *cluster) namespace scenes_management { namespace command { - command_t *create_add_scene(cluster_t *cluster) { return esp_matter::command::create(cluster, ScenesManagement::Commands::AddScene::Id, COMMAND_FLAG_ACCEPTED, NULL); diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp index 1d683d452..49c7acd50 100644 --- a/components/esp_matter/esp_matter_endpoint.cpp +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -256,7 +256,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); return ESP_OK; @@ -292,7 +291,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -329,7 +327,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -369,10 +366,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - cluster_t *scenes_cluster = scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); - scenes_management::command::create_copy_scene(scenes_cluster); - scenes_management::command::create_copy_scene_response(scenes_cluster); - on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -561,7 +554,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); return ESP_OK; @@ -596,7 +588,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *identify_cluster = identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); identify::command::create_trigger_effect(identify_cluster); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); on_off::create(endpoint, &(config->on_off), CLUSTER_FLAG_SERVER, on_off::feature::lighting::get_id()); level_control::create(endpoint, &(config->level_control), CLUSTER_FLAG_SERVER, level_control::feature::on_off::get_id() | level_control::feature::lighting::get_id()); @@ -734,7 +725,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER | CLUSTER_FLAG_CLIENT); groups::create(endpoint, NULL, CLUSTER_FLAG_CLIENT); - scenes_management::create(endpoint, NULL, CLUSTER_FLAG_CLIENT); on_off::create(endpoint, NULL, CLUSTER_FLAG_CLIENT, ESP_MATTER_NONE_FEATURE_ID); level_control::create(endpoint, NULL, CLUSTER_FLAG_CLIENT, ESP_MATTER_NONE_FEATURE_ID); color_control::create(endpoint, NULL, CLUSTER_FLAG_CLIENT, ESP_MATTER_NONE_FEATURE_ID); @@ -1029,7 +1019,6 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) identify::create(endpoint, &(config->identify), CLUSTER_FLAG_SERVER); groups::create(endpoint, &(config->groups), CLUSTER_FLAG_SERVER); - scenes_management::create(endpoint, &(config->scenes_management), CLUSTER_FLAG_SERVER); window_covering::create(endpoint, &(config->window_covering), CLUSTER_FLAG_SERVER, ESP_MATTER_NONE_FEATURE_ID); return ESP_OK; diff --git a/components/esp_matter/esp_matter_endpoint.h b/components/esp_matter/esp_matter_endpoint.h index 9d1b0ed1b..979b9a5d8 100644 --- a/components/esp_matter/esp_matter_endpoint.h +++ b/components/esp_matter/esp_matter_endpoint.h @@ -161,6 +161,10 @@ typedef struct : app_base_config { cluster::binding::config_t binding; } app_client_config; +typedef struct : app_with_group_config { + cluster::on_off::config_t on_off; +} on_off_config; + typedef struct : app_with_group_config { cluster::scenes_management::config_t scenes_management; cluster::on_off::config_t on_off; @@ -232,7 +236,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace on_off_light { -using config_t = on_off_with_scenes_management_config; +using config_t = on_off_config; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -316,7 +320,7 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace on_off_plugin_unit { -using config_t = on_off_with_scenes_management_config; +using config_t = on_off_config; uint32_t get_device_type_id(); uint8_t get_device_type_version(); diff --git a/components/esp_matter/esp_matter_feature.h b/components/esp_matter/esp_matter_feature.h index 7e8e3d8d0..c56f582bf 100644 --- a/components/esp_matter/esp_matter_feature.h +++ b/components/esp_matter/esp_matter_feature.h @@ -275,7 +275,7 @@ typedef struct config { uint16_t couple_color_temp_to_level_min_mireds; nullable startup_color_temperature_mireds; config() : color_temperature_mireds(0x00fa), color_temp_physical_min_mireds(0), - color_temp_physical_max_mireds(0xfeff), couple_color_temp_to_level_min_mireds(0), + color_temp_physical_max_mireds(0xfeff), couple_color_temp_to_level_min_mireds(1), startup_color_temperature_mireds(0x00fa) {} } config_t;