Skip to content

Commit a58b550

Browse files
committed
feat(matter): dimmable friend class and adjusts log levels
1 parent 8c44945 commit a58b550

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

libraries/Matter/src/Matter.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,26 @@ esp_err_t matter_light_attribute_update(
2727
static esp_err_t app_attribute_update_cb(
2828
attribute::callback_type_t type, uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val, void *priv_data
2929
) {
30+
log_d("Attribute update callback: type: %u, endpoint: %u, cluster: %u, attribute: %u, val: %u", type, endpoint_id, cluster_id, attribute_id, val->val.u32);
3031
esp_err_t err = ESP_OK;
3132
MatterEndPoint *ep = (MatterEndPoint *)priv_data; // endpoint pointer to base class
3233
switch (type) {
3334
case PRE_UPDATE: // Callback before updating the value in the database
34-
log_i("Attribute update callback: PRE_UPDATE");
35+
log_v("Attribute update callback: PRE_UPDATE");
3536
if (ep != NULL) {
3637
err = ep->attributeChangeCB(endpoint_id, cluster_id, attribute_id, val) ? ESP_OK : ESP_FAIL;
3738
}
3839
break;
3940
case POST_UPDATE: // Callback after updating the value in the database
40-
log_i("Attribute update callback: POST_UPDATE");
41+
log_v("Attribute update callback: POST_UPDATE");
4142
break;
4243
case READ: // Callback for reading the attribute value. This is used when the `ATTRIBUTE_FLAG_OVERRIDE` is set.
43-
log_i("Attribute update callback: READ");
44+
log_v("Attribute update callback: READ");
4445
break;
4546
case WRITE: // Callback for writing the attribute value. This is used when the `ATTRIBUTE_FLAG_OVERRIDE` is set.
46-
log_i("Attribute update callback: WRITE");
47+
log_v("Attribute update callback: WRITE");
4748
break;
48-
default: log_i("Attribute update callback: Unknown type %d", type);
49+
default: log_v("Attribute update callback: Unknown type %d", type);
4950
}
5051
return err;
5152
}
@@ -114,7 +115,7 @@ void ArduinoMatter::_init() {
114115

115116
void ArduinoMatter::begin() {
116117
if (!_matter_has_started) {
117-
log_w("No Matter endpoint has been created. Please create an endpoint first.");
118+
log_e("No Matter endpoint has been created. Please create an endpoint first.");
118119
return;
119120
}
120121

libraries/Matter/src/Matter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ArduinoMatter {
3030

3131
// list of Matter EndPoints Friend Classes
3232
friend class MatterOnOffLight;
33+
friend class MatterDimmableLight;
3334

3435
protected:
3536
static void _init();

0 commit comments

Comments
 (0)