diff --git a/components/esp_matter/esp_matter_endpoint.cpp b/components/esp_matter/esp_matter_endpoint.cpp index 34ec1e959..b73bde38f 100644 --- a/components/esp_matter/esp_matter_endpoint.cpp +++ b/components/esp_matter/esp_matter_endpoint.cpp @@ -1825,13 +1825,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) descriptor::feature::taglist::add(descriptor_cluster); power_source_device::add(endpoint, &config->power_source_device); - - cluster_t *power_source_cluster = cluster::get(endpoint, PowerSource::Id); -<<<<<<< HEAD + + cluster_t *power_source_cluster = cluster::get(endpoint, PowerSource::Id); power_source::feature::wired::add(power_source_cluster, &config->power_source_device.power_source.features.wired); -======= - power_source::feature::wired::add(power_source_cluster, &config->power_source_device.power_source.wired); ->>>>>>> 1ac31669 (Revert "components/esp-matter: update default identify type value for all devices") electrical_sensor::add(endpoint, &config->electrical_sensor); electrical_energy_measurement::create(endpoint, &(config->electrical_energy_measurement), CLUSTER_FLAG_SERVER, electrical_energy_measurement::feature::exported_energy::get_id() | electrical_energy_measurement::feature::cumulative_energy::get_id()); @@ -1869,10 +1865,10 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) cluster_t *descriptor_cluster = cluster::get(endpoint, Descriptor::Id); descriptor::feature::taglist::add(descriptor_cluster); - + power_source_device::add(endpoint, &config->power_source_device); - - cluster_t *power_source_cluster = cluster::get(endpoint, PowerSource::Id); + + cluster_t *power_source_cluster = cluster::get(endpoint, PowerSource::Id); power_source::feature::wired::add(power_source_cluster, &config->power_source_device.power_source.features.wired); power_source::feature::battery::add(power_source_cluster, &config->power_source_device.power_source.features.battery); diff --git a/components/esp_matter/esp_matter_endpoint.h b/components/esp_matter/esp_matter_endpoint.h index ac3296670..aff6b1d3b 100644 --- a/components/esp_matter/esp_matter_endpoint.h +++ b/components/esp_matter/esp_matter_endpoint.h @@ -248,7 +248,12 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace on_off_light { -using config_t = on_off_config; +typedef struct config : on_off_config { + config() { + /* For lighting product, the default identify type should be 0x01: LightOutput*/ + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kLightOutput); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -291,7 +296,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace on_off_switch { -using config_t = app_client_config; +typedef struct config : app_client_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -301,7 +310,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace dimmer_switch { -using config_t = app_client_config; +typedef struct config : app_client_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -311,7 +324,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace color_dimmer_switch { -using config_t = app_client_config; +typedef struct config : app_client_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -321,6 +338,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace generic_switch { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::switch_cluster::config_t switch_cluster; } config_t; @@ -332,7 +352,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace on_off_plugin_unit { -using config_t = on_off_config; +typedef struct config : on_off_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -353,6 +377,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace fan { typedef struct config : app_with_group_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } cluster::fan_control::config_t fan_control; } config_t; @@ -364,6 +391,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace thermostat { typedef struct config : app_with_group_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::scenes_management::config_t scenes_management; cluster::thermostat::config_t thermostat; } config_t; @@ -376,6 +406,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace air_quality_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::air_quality::config_t air_quality; } config_t; @@ -387,6 +420,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace air_purifier { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } cluster::fan_control::config_t fan_control; } config_t; @@ -425,6 +461,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace smoke_co_alarm { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kAudibleBeep); + } cluster::smoke_co_alarm::config_t smoke_co_alarm; } config_t; uint32_t get_device_type_id(); @@ -469,6 +508,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace door_lock { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kAudibleBeep); + } cluster::door_lock::config_t door_lock; } config_t; @@ -482,7 +524,9 @@ namespace window_covering_device { typedef struct config : app_with_group_config { cluster::scenes_management::config_t scenes_management; cluster::window_covering::config_t window_covering; - config(uint8_t end_product_type = 0) : window_covering(end_product_type) {} + config(uint8_t end_product_type = 0) : window_covering(end_product_type) { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } } config_t; uint32_t get_device_type_id(); @@ -493,6 +537,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace temperature_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::temperature_measurement::config_t temperature_measurement; } config_t; @@ -504,6 +551,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace humidity_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::relative_humidity_measurement::config_t relative_humidity_measurement; } config_t; @@ -515,6 +565,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace occupancy_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kAudibleBeep); + } cluster::occupancy_sensing::config_t occupancy_sensing; } config_t; @@ -525,7 +578,12 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); } /* occupancy_sensor */ namespace contact_sensor { -using config_t = app_with_bool_state_config; + +typedef struct config : app_with_bool_state_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -535,6 +593,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace light_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::illuminance_measurement::config_t illuminance_measurement; } config_t; @@ -546,6 +607,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace pressure_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::pressure_measurement::config_t pressure_measurement; } config_t; @@ -557,6 +621,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace flow_sensor { typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::flow_measurement::config_t flow_measurement; } config_t; @@ -574,7 +641,9 @@ typedef struct config : app_base_config { nullable max_pressure = nullable(), nullable max_speed = nullable(), nullable max_flow = nullable() - ) : pump_configuration_and_control(max_pressure, max_speed, max_flow) {} + ) : pump_configuration_and_control(max_pressure, max_speed, max_flow) { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } } config_t; uint32_t get_device_type_id(); @@ -585,6 +654,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace pump_controller { typedef struct config : app_client_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } cluster::on_off::config_t on_off; cluster::pump_configuration_and_control::config_t pump_configuration_and_control; } config_t; @@ -609,6 +681,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace room_air_conditioner{ typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } cluster::on_off::config_t on_off; cluster::thermostat::config_t thermostat; } config_t; @@ -655,6 +730,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace robotic_vacuum_cleaner{ typedef struct config : app_base_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } cluster::rvc_run_mode::config_t rvc_run_mode; cluster::rvc_operational_state::config_t rvc_operational_state; } config_t; @@ -666,7 +744,12 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); } /** robotic_vacuum_cleaner **/ namespace water_leak_detector { -using config_t = app_with_bool_state_config; + +typedef struct config : app_with_bool_state_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -676,7 +759,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace water_freeze_detector { -using config_t = app_with_bool_state_config; +typedef struct config : app_with_bool_state_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -686,7 +773,11 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace rain_sensor { -using config_t = app_with_bool_state_config; +typedef struct config : app_with_bool_state_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kVisibleIndicator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version(); @@ -772,6 +863,9 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); namespace water_valve { typedef struct config : app_base_config { cluster::valve_configuration_and_control::config_t valve_configuration_and_control; + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } } config_t; uint32_t get_device_type_id(); @@ -819,7 +913,12 @@ esp_err_t add(endpoint_t *endpoint, config_t *config); } /* secondary_network_interface */ namespace mounted_on_off_control { -using config_t = on_off_config; + +typedef struct config : on_off_config { + config() { + identify.identify_type = chip::to_underlying(chip::app::Clusters::Identify::IdentifyTypeEnum::kActuator); + } +} config_t; uint32_t get_device_type_id(); uint8_t get_device_type_version();