Skip to content

Commit 2cb0819

Browse files
authored
feat(matter): adds esp_matter:: namespace to attribute_t (#10807)
* feat(matter): adds esp_matter:: namespace to attribute_t * feat(matter): adds esp_matter:: namespace to attribute_t * feat(matter): adds esp_matter:: namespace to attribute_t * feat(matter): adds esp_matter:: namespace to attribute_t * feat(matter): adds esp_matter:: namespace to attribute_t * feat(matter): adds esp_matter:: namespace to attribute_t
1 parent 5f44c4e commit 2cb0819

6 files changed

+21
-21
lines changed

libraries/Matter/src/MatterEndPoint.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class MatterEndPoint {
3838
}
3939

4040
// helper functions for attribute manipulation
41-
attribute_t *getAttribute(uint32_t cluster_id, uint32_t attribute_id) {
41+
esp_matter::attribute_t *getAttribute(uint32_t cluster_id, uint32_t attribute_id) {
4242
if (endpoint_id == 0) {
4343
log_e("Endpoint ID is not set");
4444
return NULL;
@@ -53,7 +53,7 @@ class MatterEndPoint {
5353
log_e("Cluster [%d] not found", cluster_id);
5454
return NULL;
5555
}
56-
attribute_t *attribute = attribute::get(cluster, attribute_id);
56+
esp_matter::attribute_t *attribute = attribute::get(cluster, attribute_id);
5757
if (attribute == NULL) {
5858
log_e("Attribute [%d] not found", attribute_id);
5959
return NULL;
@@ -63,7 +63,7 @@ class MatterEndPoint {
6363

6464
// get the value of an attribute from its cluster id and attribute it
6565
bool getAttributeVal(uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *attrVal) {
66-
attribute_t *attribute = getAttribute(cluster_id, attribute_id);
66+
esp_matter::attribute_t *attribute = getAttribute(cluster_id, attribute_id);
6767
if (attribute == NULL) {
6868
return false;
6969
}
@@ -77,7 +77,7 @@ class MatterEndPoint {
7777

7878
// set the value of an attribute from its cluster id and attribute it
7979
bool setAttributeVal(uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *attrVal) {
80-
attribute_t *attribute = getAttribute(cluster_id, attribute_id);
80+
esp_matter::attribute_t *attribute = getAttribute(cluster_id, attribute_id);
8181
if (attribute == NULL) {
8282
return false;
8383
}

libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ bool MatterColorLight::begin(bool initialState, espHsvColor_t _colorHSV) {
194194

195195
/* Mark deferred persistence for some attributes that might be changed rapidly */
196196
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
197-
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
197+
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
198198
attribute::set_deferred_persistence(current_level_attribute);
199199

200200
started = true;
@@ -220,7 +220,7 @@ bool MatterColorLight::setOnOff(bool newState) {
220220

221221
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
222222
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
223-
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
223+
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
224224

225225
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
226226
attribute::get_val(attribute, &val);
@@ -271,7 +271,7 @@ bool MatterColorLight::setColorHSV(espHsvColor_t _hsvColor) {
271271
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
272272
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
273273
// update hue
274-
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
274+
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
275275
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
276276
attribute::get_val(attribute, &val);
277277
if (val.val.u8 != colorHSV.h) {

libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ bool MatterColorTemperatureLight::begin(bool initialState, uint8_t brightness, u
122122

123123
/* Mark deferred persistence for some attributes that might be changed rapidly */
124124
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
125-
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
125+
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
126126
attribute::set_deferred_persistence(current_level_attribute);
127127

128128
cluster_t *color_control_cluster = cluster::get(endpoint, ColorControl::Id);
129-
attribute_t *color_temp_attribute = attribute::get(color_control_cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
129+
esp_matter::attribute_t *color_temp_attribute = attribute::get(color_control_cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
130130
attribute::set_deferred_persistence(color_temp_attribute);
131131

132132
started = true;
@@ -152,7 +152,7 @@ bool MatterColorTemperatureLight::setOnOff(bool newState) {
152152

153153
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
154154
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
155-
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
155+
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
156156

157157
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
158158
attribute::get_val(attribute, &val);
@@ -193,7 +193,7 @@ bool MatterColorTemperatureLight::setBrightness(uint8_t newBrightness) {
193193

194194
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
195195
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
196-
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
196+
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
197197

198198
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
199199
attribute::get_val(attribute, &val);
@@ -224,7 +224,7 @@ bool MatterColorTemperatureLight::setColorTemperature(uint16_t newTemperature) {
224224

225225
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
226226
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
227-
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
227+
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
228228

229229
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
230230
attribute::get_val(attribute, &val);

libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bool MatterDimmableLight::begin(bool initialState, uint8_t brightness) {
101101

102102
/* Mark deferred persistence for some attributes that might be changed rapidly */
103103
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
104-
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
104+
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
105105
attribute::set_deferred_persistence(current_level_attribute);
106106

107107
started = true;
@@ -127,7 +127,7 @@ bool MatterDimmableLight::setOnOff(bool newState) {
127127

128128
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
129129
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
130-
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
130+
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
131131

132132
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
133133
attribute::get_val(attribute, &val);
@@ -168,7 +168,7 @@ bool MatterDimmableLight::setBrightness(uint8_t newBrightness) {
168168

169169
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
170170
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
171-
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
171+
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
172172

173173
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
174174
attribute::get_val(attribute, &val);

libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ bool MatterEnhancedColorLight::begin(bool initialState, espHsvColor_t _colorHSV,
214214

215215
/* Mark deferred persistence for some attributes that might be changed rapidly */
216216
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
217-
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
217+
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
218218
attribute::set_deferred_persistence(current_level_attribute);
219219

220220
started = true;
@@ -240,7 +240,7 @@ bool MatterEnhancedColorLight::setOnOff(bool newState) {
240240

241241
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
242242
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
243-
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
243+
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
244244

245245
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
246246
attribute::get_val(attribute, &val);
@@ -281,7 +281,7 @@ bool MatterEnhancedColorLight::setBrightness(uint8_t newBrightness) {
281281

282282
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
283283
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
284-
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
284+
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
285285

286286
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
287287
attribute::get_val(attribute, &val);
@@ -312,7 +312,7 @@ bool MatterEnhancedColorLight::setColorTemperature(uint16_t newTemperature) {
312312

313313
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
314314
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
315-
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
315+
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
316316

317317
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
318318
attribute::get_val(attribute, &val);
@@ -353,7 +353,7 @@ bool MatterEnhancedColorLight::setColorHSV(espHsvColor_t _hsvColor) {
353353
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
354354
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
355355
// update hue
356-
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
356+
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
357357
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
358358
attribute::get_val(attribute, &val);
359359
if (val.val.u8 != colorHSV.h) {

libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ bool MatterOnOffLight::setOnOff(bool newState) {
108108

109109
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
110110
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
111-
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
111+
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
112112

113113
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
114114
attribute::get_val(attribute, &val);

0 commit comments

Comments
 (0)