components/esp-matter: fix types for on_time and off_wait_time

These are non-nullable uint16's, so removed the nullable type
This commit is contained in:
Shubham Patil
2025-12-04 22:07:51 +05:30
parent ca1759c0e0
commit 46cac96d3b
4 changed files with 14 additions and 10 deletions
@@ -1504,18 +1504,18 @@ attribute_t *create_global_scene_control(cluster_t *cluster, bool value)
esp_matter_bool(value));
}
attribute_t *create_on_time(cluster_t *cluster, nullable<uint16_t> value)
attribute_t *create_on_time(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, OnOff::Attributes::OnTime::Id,
ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NULLABLE,
esp_matter_nullable_uint16(value));
ATTRIBUTE_FLAG_WRITABLE,
esp_matter_uint16(value));
}
attribute_t *create_off_wait_time(cluster_t *cluster, nullable<uint16_t> value)
attribute_t *create_off_wait_time(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, OnOff::Attributes::OffWaitTime::Id,
ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NULLABLE,
esp_matter_nullable_uint16(value));
ATTRIBUTE_FLAG_WRITABLE,
esp_matter_uint16(value));
}
attribute_t *create_start_up_on_off(cluster_t *cluster, nullable<uint8_t> value)
@@ -399,8 +399,8 @@ namespace on_off {
namespace attribute {
attribute_t *create_on_off(cluster_t *cluster, bool value);
attribute_t *create_global_scene_control(cluster_t *cluster, bool value);
attribute_t *create_on_time(cluster_t *cluster, nullable<uint16_t> value);
attribute_t *create_off_wait_time(cluster_t *cluster, nullable<uint16_t> value);
attribute_t *create_on_time(cluster_t *cluster, uint16_t value);
attribute_t *create_off_wait_time(cluster_t *cluster, uint16_t value);
attribute_t *create_start_up_on_off(cluster_t *cluster, nullable<uint8_t> value);
} /* attribute */
} /* on_off */
@@ -934,6 +934,10 @@ esp_err_t set_val(attribute_t *attribute, esp_matter_attr_val_t *val)
ESP_RETURN_ON_FALSE(!(current_attribute->flags & ATTRIBUTE_FLAG_MANAGED_INTERNALLY), ESP_ERR_NOT_SUPPORTED, TAG,
"Attribute is not managed by esp matter data model");
// As we know that this is esp-matter managed attribute, we can safely log the path
ESP_LOGD(TAG, "setting attribute value for: 0x%x:0x%" PRIx32 ":0x%" PRIx32, current_attribute->endpoint_id,
current_attribute->cluster_id, current_attribute->attribute_id);
if (val->type == ESP_MATTER_VAL_TYPE_CHAR_STRING || val->type == ESP_MATTER_VAL_TYPE_OCTET_STRING ||
val->type == ESP_MATTER_VAL_TYPE_LONG_CHAR_STRING || val->type == ESP_MATTER_VAL_TYPE_LONG_OCTET_STRING ||
val->type == ESP_MATTER_VAL_TYPE_ARRAY) {
@@ -214,8 +214,8 @@ namespace lighting {
typedef struct config {
bool global_scene_control;
nullable<uint16_t> on_time;
nullable<uint16_t> off_wait_time;
uint16_t on_time;
uint16_t off_wait_time;
nullable<uint8_t> start_up_on_off;
config() : global_scene_control(1), on_time(0), off_wait_time(0), start_up_on_off(0) {}
} config_t;