Merge branch 'add_bounds_of_thermostat_user_interface_configuration_cluster' into 'release/v1.3'

components/esp-matter:add bounds of thermostat user interface configuration cluster

See merge request app-frameworks/esp-matter!961
This commit is contained in:
Shu Chen
2024-12-16 17:59:28 +08:00
2 changed files with 33 additions and 12 deletions
+30 -9
View File
@@ -1997,22 +1997,43 @@ attribute_t *create_ac_capacity_format(cluster_t *cluster, uint8_t value)
namespace thermostat_user_interface_configuration {
namespace attribute {
attribute_t *create_temperature_display_mode(cluster_t *cluster, uint8_t value)
attribute_t *create_temperature_display_mode(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max)
{
return esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
attribute_t *attribute =
esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::TemperatureDisplayMode::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
if (!attribute) {
ESP_LOGE(TAG, "Could not create attribute");
return NULL;
}
esp_matter::attribute::add_bounds(attribute, esp_matter_uint8(min), esp_matter_uint8(max));
return attribute;
}
attribute_t *create_keypad_lockout(cluster_t *cluster, uint8_t value)
attribute_t *create_keypad_lockout(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max)
{
return esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
attribute_t *attribute =
esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::KeypadLockout::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
if (!attribute) {
ESP_LOGE(TAG, "Could not create attribute");
return NULL;
}
esp_matter::attribute::add_bounds(attribute, esp_matter_uint8(min), esp_matter_uint8(max));
return attribute;
}
attribute_t *create_schedule_programming_visibility(cluster_t *cluster, uint8_t value)
attribute_t *create_schedule_programming_visibility(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max)
{
return esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
attribute_t *attribute =
esp_matter::attribute::create(cluster, ThermostatUserInterfaceConfiguration::Attributes::ScheduleProgrammingVisibility::Id,
ATTRIBUTE_FLAG_WRITABLE, esp_matter_enum8(value));
if (!attribute) {
ESP_LOGE(TAG, "Could not create attribute");
return NULL;
}
esp_matter::attribute::add_bounds(attribute, esp_matter_uint8(min), esp_matter_uint8(max));
return attribute;
}
} /* attribute */
+3 -3
View File
@@ -446,9 +446,9 @@ attribute_t *create_ac_capacity_format(cluster_t *cluster, uint8_t value);
namespace thermostat_user_interface_configuration {
namespace attribute {
attribute_t *create_temperature_display_mode(cluster_t *cluster, uint8_t value);
attribute_t *create_keypad_lockout(cluster_t *cluster, uint8_t value);
attribute_t *create_schedule_programming_visibility(cluster_t *cluster, uint8_t value);
attribute_t *create_temperature_display_mode(cluster_t *cluster, uint8_t value, uint8_t min = 0, uint8_t max = 1);
attribute_t *create_keypad_lockout(cluster_t *cluster, uint8_t value, uint8_t min = 0, uint8_t max = 5);
attribute_t *create_schedule_programming_visibility(cluster_t *cluster, uint8_t value, uint8_t min = 0, uint8_t max = 1);
} /* attribute */
} /* thermostat_user_interface_configuration */