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 405bc3d537
commit ad2ea4f55b
4 changed files with 12 additions and 8 deletions
@@ -1510,18 +1510,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,
esp_matter_nullable_uint16(value));
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,
esp_matter_nullable_uint16(value));
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 */
@@ -647,6 +647,10 @@ esp_err_t set_val_internal(attribute_t *attribute, esp_matter_attr_val_t *val, b
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);
VerifyOrReturnError(current_attribute->attribute_val_type == val->type, ESP_ERR_INVALID_ARG,
ESP_LOGE(TAG, "Different value type : Expected Type : %u Attempted Type: %u",
current_attribute->attribute_val_type, val->type));
@@ -211,8 +211,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;