Skip to content

Commit 0c4e0a0

Browse files
committed
Merge branch 'fix-attribute-types' into 'main'
components/esp-matter: fix types for on_time and off_wait_time See merge request app-frameworks/esp-matter!1332
2 parents 3dcc62b + ad2ea4f commit 0c4e0a0

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

components/esp_matter/data_model/esp_matter_attribute.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,18 +1510,18 @@ attribute_t *create_global_scene_control(cluster_t *cluster, bool value)
15101510
esp_matter_bool(value));
15111511
}
15121512

1513-
attribute_t *create_on_time(cluster_t *cluster, nullable<uint16_t> value)
1513+
attribute_t *create_on_time(cluster_t *cluster, uint16_t value)
15141514
{
15151515
return esp_matter::attribute::create(cluster, OnOff::Attributes::OnTime::Id,
15161516
ATTRIBUTE_FLAG_WRITABLE,
1517-
esp_matter_nullable_uint16(value));
1517+
esp_matter_uint16(value));
15181518
}
15191519

1520-
attribute_t *create_off_wait_time(cluster_t *cluster, nullable<uint16_t> value)
1520+
attribute_t *create_off_wait_time(cluster_t *cluster, uint16_t value)
15211521
{
15221522
return esp_matter::attribute::create(cluster, OnOff::Attributes::OffWaitTime::Id,
15231523
ATTRIBUTE_FLAG_WRITABLE,
1524-
esp_matter_nullable_uint16(value));
1524+
esp_matter_uint16(value));
15251525
}
15261526

15271527
attribute_t *create_start_up_on_off(cluster_t *cluster, nullable<uint8_t> value)

components/esp_matter/data_model/esp_matter_attribute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ namespace on_off {
399399
namespace attribute {
400400
attribute_t *create_on_off(cluster_t *cluster, bool value);
401401
attribute_t *create_global_scene_control(cluster_t *cluster, bool value);
402-
attribute_t *create_on_time(cluster_t *cluster, nullable<uint16_t> value);
403-
attribute_t *create_off_wait_time(cluster_t *cluster, nullable<uint16_t> value);
402+
attribute_t *create_on_time(cluster_t *cluster, uint16_t value);
403+
attribute_t *create_off_wait_time(cluster_t *cluster, uint16_t value);
404404
attribute_t *create_start_up_on_off(cluster_t *cluster, nullable<uint8_t> value);
405405
} /* attribute */
406406
} /* on_off */

components/esp_matter/data_model/esp_matter_data_model.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,10 @@ esp_err_t set_val_internal(attribute_t *attribute, esp_matter_attr_val_t *val, b
647647
ESP_RETURN_ON_FALSE(!(current_attribute->flags & ATTRIBUTE_FLAG_MANAGED_INTERNALLY), ESP_ERR_NOT_SUPPORTED, TAG,
648648
"Attribute is not managed by esp matter data model");
649649

650+
// As we know that this is esp-matter managed attribute, we can safely log the path
651+
ESP_LOGD(TAG, "setting attribute value for: 0x%x:0x%" PRIx32 ":0x%" PRIx32, current_attribute->endpoint_id,
652+
current_attribute->cluster_id, current_attribute->attribute_id);
653+
650654
VerifyOrReturnError(current_attribute->attribute_val_type == val->type, ESP_ERR_INVALID_ARG,
651655
ESP_LOGE(TAG, "Different value type : Expected Type : %u Attempted Type: %u",
652656
current_attribute->attribute_val_type, val->type));

components/esp_matter/data_model/esp_matter_feature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ namespace lighting {
211211

212212
typedef struct config {
213213
bool global_scene_control;
214-
nullable<uint16_t> on_time;
215-
nullable<uint16_t> off_wait_time;
214+
uint16_t on_time;
215+
uint16_t off_wait_time;
216216
nullable<uint8_t> start_up_on_off;
217217
config() : global_scene_control(1), on_time(0), off_wait_time(0), start_up_on_off(0) {}
218218
} config_t;

0 commit comments

Comments
 (0)