components/esp-matter: conformance fixes for thermostat cluster

- moved cluster revision from 8 to 9
- thermostat cluster has schedule and preset attributes with quality T
  i.e. atomic. It requires the cluster to implement atomic-request and
  atomic-response command.
This commit is contained in:
Shubham Patil
2025-08-28 18:49:29 +05:30
parent a40259cd96
commit 16f51d2b9c
4 changed files with 32 additions and 1 deletions
@@ -1342,6 +1342,13 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
/* Commands */
command::create_setpoint_raise_lower(cluster);
// matter_schedule_configuration and presets contains the attributes with T i.e. atomic quality
// hence, we need to create the atomic request and response commands
if (has(feature::matter_schedule_configuration::get_id()) || has(feature::presets::get_id())) {
command::create_atomic_request(cluster);
command::create_atomic_response(cluster);
}
return cluster;
}
} /* thermostat */
@@ -1095,6 +1095,17 @@ static esp_err_t esp_matter_command_callback_set_active_schedule_request(const C
return ESP_OK;
}
static esp_err_t esp_matter_command_callback_thermostat_atomic_request(const ConcreteCommandPath &command_path,
TLVReader &tlv_data, void *opaque_ptr)
{
chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType command_data;
CHIP_ERROR error = Decode(tlv_data, command_data);
if (error == CHIP_NO_ERROR) {
emberAfThermostatClusterAtomicRequestCallback((CommandHandler *)opaque_ptr, command_path, command_data);
}
return ESP_OK;
}
static esp_err_t esp_matter_command_callback_set_active_preset_request(const ConcreteCommandPath &command_path,
TLVReader &tlv_data, void *opaque_ptr)
{
@@ -2560,6 +2571,17 @@ command_t *create_set_active_preset_request(cluster_t *cluster)
esp_matter_command_callback_set_active_preset_request);
}
command_t *create_atomic_request(cluster_t *cluster)
{
return esp_matter::command::create(cluster, Thermostat::Commands::AtomicRequest::Id, COMMAND_FLAG_ACCEPTED,
esp_matter_command_callback_thermostat_atomic_request);
}
command_t *create_atomic_response(cluster_t *cluster)
{
return esp_matter::command::create(cluster, Thermostat::Commands::AtomicResponse::Id, COMMAND_FLAG_GENERATED, NULL);
}
} /* command */
} /* thermostat */
@@ -299,6 +299,8 @@ command_t *create_clear_weekly_schedule(cluster_t *cluster);
command_t *create_get_weekly_schedule_response(cluster_t *cluster);
command_t *create_set_active_schedule_request(cluster_t *cluster);
command_t *create_set_active_preset_request(cluster_t *cluster);
command_t *create_atomic_request(cluster_t *cluster);
command_t *create_atomic_response(cluster_t *cluster);
} /* command */
} /* thermostat */
@@ -148,7 +148,7 @@ constexpr uint16_t cluster_revision = 4;
} // namespace fan_control
namespace thermostat {
constexpr uint16_t cluster_revision = 8;
constexpr uint16_t cluster_revision = 9;
} // namespace thermostat
namespace thermostat_user_interface_configuration {