diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index 001ef0d60..b4926677c 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -1382,7 +1382,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) global::attribute::create_cluster_revision(cluster, config->cluster_revision); attribute::create_type(cluster, config->type); attribute::create_config_status(cluster, config->config_status); - attribute::create_operational_status(cluster, config->config_status); + attribute::create_operational_status(cluster, config->operational_status); attribute::create_end_product_type(cluster, config->end_product_type); attribute::create_mode(cluster, config->mode); } else { diff --git a/components/esp_matter/esp_matter_cluster.h b/components/esp_matter/esp_matter_cluster.h index 29ca709ef..3fc5e259e 100644 --- a/components/esp_matter/esp_matter_cluster.h +++ b/components/esp_matter/esp_matter_cluster.h @@ -341,7 +341,7 @@ typedef struct config { uint16_t installed_closed_limit_tilt; uint16_t mode; uint16_t safety_status; - config() : cluster_revision(6), type(0), operational_status(0), end_product_type(0), mode(0) {} + config() : cluster_revision(5), type(0), operational_status(0), end_product_type(0), mode(0) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); diff --git a/components/esp_matter/esp_matter_feature.cpp b/components/esp_matter/esp_matter_feature.cpp index 3b493985a..978732f33 100644 --- a/components/esp_matter/esp_matter_feature.cpp +++ b/components/esp_matter/esp_matter_feature.cpp @@ -454,36 +454,47 @@ esp_err_t add(cluster_t *cluster, config_t *config) } update_feature_map(cluster, get_id()); - uint32_t abs_and_pa_lf_feature_map = get_id() | feature::position_aware_lift::get_id(); - uint32_t abs_and_pa_tl_feature_map = get_id() | feature::position_aware_tilt::get_id(); + uint32_t abs_and_pa_lf_and_lf_feature_map = get_id() | feature::position_aware_lift::get_id() | feature::lift::get_id(); + uint32_t abs_and_pa_tl_and_tl_feature_map = get_id() | feature::position_aware_tilt::get_id() | feature::tilt::get_id(); uint32_t abs_and_lift_feature_map = get_id() | feature::lift::get_id(); uint32_t abs_and_tilt_feature_map = get_id() | feature::tilt::get_id(); - if((get_feature_map_value(cluster) & abs_and_pa_lf_feature_map) == abs_and_pa_lf_feature_map) { + if ( + (get_feature_map_value(cluster) & abs_and_pa_lf_and_lf_feature_map) != abs_and_pa_lf_and_lf_feature_map + && (get_feature_map_value(cluster) & abs_and_pa_tl_and_tl_feature_map) != abs_and_pa_tl_and_tl_feature_map + && (get_feature_map_value(cluster) & abs_and_lift_feature_map) != abs_and_lift_feature_map + && (get_feature_map_value(cluster) & abs_and_tilt_feature_map) != abs_and_tilt_feature_map + ) { + ESP_LOGE(TAG, "Cluster shall support Lift (and optionally Position_Aware_Lift) and/or Tilt (and optionally Position_Aware_Tilt) features"); + return ESP_ERR_NOT_SUPPORTED; + } + if((get_feature_map_value(cluster) & abs_and_pa_lf_and_lf_feature_map) == abs_and_pa_lf_and_lf_feature_map) { attribute::create_physical_closed_limit_lift(cluster, config->physical_closed_limit_lift); attribute::create_current_position_lift(cluster, config->current_position_lift); attribute::create_installed_open_limit_lift(cluster, config->installed_open_limit_lift); attribute::create_installed_closed_limit_lift(cluster, config->installed_closed_limit_lift); } else { - ESP_LOGE(TAG, "Cluster shall support Position_Aware_Lift feature"); - return ESP_ERR_NOT_SUPPORTED; + ESP_LOGW(TAG, "Lift related attributes were not created because cluster does not support Position_Aware_Lift feature"); } - if((get_feature_map_value(cluster) & abs_and_pa_tl_feature_map) == abs_and_pa_tl_feature_map) { + if((get_feature_map_value(cluster) & abs_and_pa_tl_and_tl_feature_map) == abs_and_pa_tl_and_tl_feature_map) { attribute::create_physical_closed_limit_tilt(cluster, config->physical_closed_limit_tilt); attribute::create_current_position_tilt(cluster, config->current_position_tilt); attribute::create_installed_open_limit_tilt(cluster, config->installed_open_limit_tilt); - attribute::create_installed_closed_limit_tilt(cluster, config->installed_closed_limit_lift); + attribute::create_installed_closed_limit_tilt(cluster, config->installed_closed_limit_tilt); } else { - ESP_LOGE(TAG, "Cluster shall support Position_Aware_Tilt feature"); - return ESP_ERR_NOT_SUPPORTED; + ESP_LOGW(TAG, "Tilt related attributes were not created because cluster does not support Position_Aware_Tilt feature"); } if((get_feature_map_value(cluster) & abs_and_lift_feature_map) == abs_and_lift_feature_map) { command::create_go_to_lift_value(cluster); + } else { + ESP_LOGW(TAG, "Lift commands were not created because cluster does not support Lift feature"); } if((get_feature_map_value(cluster) & abs_and_tilt_feature_map) == abs_and_tilt_feature_map) { - command::create_go_to_tilt_value(cluster); + command::create_go_to_tilt_value(cluster); + } else { + ESP_LOGW(TAG, "Tilt commands were not created because cluster does not support Tilt feature"); } return ESP_OK;