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
This commit is contained in:
parent
5f44c4ebc5
commit
2cb08193d8
6 changed files with 21 additions and 21 deletions
|
|
@ -38,7 +38,7 @@ public:
|
|||
}
|
||||
|
||||
// helper functions for attribute manipulation
|
||||
attribute_t *getAttribute(uint32_t cluster_id, uint32_t attribute_id) {
|
||||
esp_matter::attribute_t *getAttribute(uint32_t cluster_id, uint32_t attribute_id) {
|
||||
if (endpoint_id == 0) {
|
||||
log_e("Endpoint ID is not set");
|
||||
return NULL;
|
||||
|
|
@ -53,7 +53,7 @@ public:
|
|||
log_e("Cluster [%d] not found", cluster_id);
|
||||
return NULL;
|
||||
}
|
||||
attribute_t *attribute = attribute::get(cluster, attribute_id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, attribute_id);
|
||||
if (attribute == NULL) {
|
||||
log_e("Attribute [%d] not found", attribute_id);
|
||||
return NULL;
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
// get the value of an attribute from its cluster id and attribute it
|
||||
bool getAttributeVal(uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *attrVal) {
|
||||
attribute_t *attribute = getAttribute(cluster_id, attribute_id);
|
||||
esp_matter::attribute_t *attribute = getAttribute(cluster_id, attribute_id);
|
||||
if (attribute == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ public:
|
|||
|
||||
// set the value of an attribute from its cluster id and attribute it
|
||||
bool setAttributeVal(uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *attrVal) {
|
||||
attribute_t *attribute = getAttribute(cluster_id, attribute_id);
|
||||
esp_matter::attribute_t *attribute = getAttribute(cluster_id, attribute_id);
|
||||
if (attribute == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ bool MatterColorLight::begin(bool initialState, espHsvColor_t _colorHSV) {
|
|||
|
||||
/* Mark deferred persistence for some attributes that might be changed rapidly */
|
||||
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
attribute::set_deferred_persistence(current_level_attribute);
|
||||
|
||||
started = true;
|
||||
|
|
@ -220,7 +220,7 @@ bool MatterColorLight::setOnOff(bool newState) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -271,7 +271,7 @@ bool MatterColorLight::setColorHSV(espHsvColor_t _hsvColor) {
|
|||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
// update hue
|
||||
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
if (val.val.u8 != colorHSV.h) {
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ bool MatterColorTemperatureLight::begin(bool initialState, uint8_t brightness, u
|
|||
|
||||
/* Mark deferred persistence for some attributes that might be changed rapidly */
|
||||
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
attribute::set_deferred_persistence(current_level_attribute);
|
||||
|
||||
cluster_t *color_control_cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
attribute_t *color_temp_attribute = attribute::get(color_control_cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
esp_matter::attribute_t *color_temp_attribute = attribute::get(color_control_cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
attribute::set_deferred_persistence(color_temp_attribute);
|
||||
|
||||
started = true;
|
||||
|
|
@ -152,7 +152,7 @@ bool MatterColorTemperatureLight::setOnOff(bool newState) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -193,7 +193,7 @@ bool MatterColorTemperatureLight::setBrightness(uint8_t newBrightness) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -224,7 +224,7 @@ bool MatterColorTemperatureLight::setColorTemperature(uint16_t newTemperature) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ bool MatterDimmableLight::begin(bool initialState, uint8_t brightness) {
|
|||
|
||||
/* Mark deferred persistence for some attributes that might be changed rapidly */
|
||||
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
attribute::set_deferred_persistence(current_level_attribute);
|
||||
|
||||
started = true;
|
||||
|
|
@ -127,7 +127,7 @@ bool MatterDimmableLight::setOnOff(bool newState) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -168,7 +168,7 @@ bool MatterDimmableLight::setBrightness(uint8_t newBrightness) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ bool MatterEnhancedColorLight::begin(bool initialState, espHsvColor_t _colorHSV,
|
|||
|
||||
/* Mark deferred persistence for some attributes that might be changed rapidly */
|
||||
cluster_t *level_control_cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *current_level_attribute = attribute::get(level_control_cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
attribute::set_deferred_persistence(current_level_attribute);
|
||||
|
||||
started = true;
|
||||
|
|
@ -240,7 +240,7 @@ bool MatterEnhancedColorLight::setOnOff(bool newState) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -281,7 +281,7 @@ bool MatterEnhancedColorLight::setBrightness(uint8_t newBrightness) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, LevelControl::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, LevelControl::Attributes::CurrentLevel::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -312,7 +312,7 @@ bool MatterEnhancedColorLight::setColorTemperature(uint16_t newTemperature) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::ColorTemperatureMireds::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
@ -353,7 +353,7 @@ bool MatterEnhancedColorLight::setColorHSV(espHsvColor_t _hsvColor) {
|
|||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, ColorControl::Id);
|
||||
// update hue
|
||||
attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, ColorControl::Attributes::CurrentHue::Id);
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
if (val.val.u8 != colorHSV.h) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ bool MatterOnOffLight::setOnOff(bool newState) {
|
|||
|
||||
endpoint_t *endpoint = endpoint::get(node::get(), endpoint_id);
|
||||
cluster_t *cluster = cluster::get(endpoint, OnOff::Id);
|
||||
attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
esp_matter::attribute_t *attribute = attribute::get(cluster, OnOff::Attributes::OnOff::Id);
|
||||
|
||||
esp_matter_attr_val_t val = esp_matter_invalid(NULL);
|
||||
attribute::get_val(attribute, &val);
|
||||
|
|
|
|||
Loading…
Reference in a new issue