Skip to content

Commit

Permalink
fix(matter): ci codespell fixes to commentaties
Browse files Browse the repository at this point in the history
  • Loading branch information
SuGlider committed Dec 9, 2024
1 parent 0fd4cce commit dadf2c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions libraries/Matter/examples/MatterFan/MatterFan.ino
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ void setup() {
Fan.begin(0, MatterFan::FAN_MODE_OFF, MatterFan::FAN_MODE_SEQ_OFF_HIGH);

// callback functions would control Fan motor
// the Matter Controller will send new data whenver the User APP or Automation request
// the Matter Controller will send new data whenever the User APP or Automation request

// single feature callbacks take place before the generic (all features) callback
// This callback will be executed whenever the speed percent matter attribute is updated
Fan.onChangeSpeedPercent([](uint8_t speedPercent) {
// setting speed to Zero, while the Fan is ON, shall turn the Fan OFF
if (speedPercent == MatterFan::OFF_SPEED && Fan.getMode() != MatterFan::FAN_MODE_OFF) {
// ATTR_SET do not update the attribute, just SET it to avoid inifinite loop
// ATTR_SET do not update the attribute, just SET it to avoid infinite loop
return Fan.setOnOff(false, Fan.ATTR_SET);
}
// changing the speed to higher than Zero, while the Fan is OFF, shall turn the Fan ON
if (speedPercent > MatterFan::OFF_SPEED && Fan.getMode() == MatterFan::FAN_MODE_OFF) {
// ATTR_SET do not update the attribute, just SET it to avoid inifinite loop
// ATTR_SET do not update the attribute, just SET it to avoid infinite loop
return Fan.setOnOff(true, Fan.ATTR_SET);
}
// for other case, just return true
Expand All @@ -115,7 +115,7 @@ void setup() {
// when the Fan is turned ON using Mode Selection, while it is OFF, shall start it by setting the speed to 50%
if (Fan.getSpeedPercent() == MatterFan::OFF_SPEED && fanMode != MatterFan::FAN_MODE_OFF) {
Serial.printf("Fan set to %s mode -- speed percentage will go to 50%%\r\n", Fan.getFanModeString(fanMode));
// ATTR_SET do not update the attribute, just SET it to avoid inifinite loop
// ATTR_SET do not update the attribute, just SET it to avoid infinite loop
return Fan.setSpeedPercent(50, Fan.ATTR_SET);
}
return true;
Expand Down
6 changes: 3 additions & 3 deletions libraries/Matter/src/MatterEndPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class MatterEndPoint {
return false;
}
if (attribute::get_val(attribute, attrVal) == ESP_OK) {
log_v("GET_VAL Suceess for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
log_v("GET_VAL Success for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
return true;
}
log_e("GET_VAL FAILED! for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
Expand All @@ -82,7 +82,7 @@ class MatterEndPoint {
return false;
}
if (attribute::set_val(attribute, attrVal) == ESP_OK) {
log_v("SET_VAL Suceess for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
log_v("SET_VAL Success for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
return true;
}
log_e("SET_VAL FAILED! for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
Expand All @@ -92,7 +92,7 @@ class MatterEndPoint {
// update the value of an attribute from its cluster id and attribute it
bool updateAttributeVal(uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *attrVal) {
if (attribute::update(endpoint_id, cluster_id, attribute_id, attrVal) == ESP_OK) {
log_v("Update Suceess for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
log_v("Update Success for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
return true;
}
log_e("Update FAILED! for cluster %d, attribute %d with value %d", cluster_id, attribute_id, attrVal->val.u32);
Expand Down
4 changes: 2 additions & 2 deletions libraries/Matter/src/MatterEndpoints/MatterFan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ bool MatterFan::begin(uint8_t percent, FanMode_t fanMode, FanModeSequence_t fanM
endpoint_t *endpoint = fan::create(node::get(), &fan_config, ENDPOINT_FLAG_NONE, (void *)this);

if (endpoint == nullptr) {
log_e("Failed to create Generic swtich endpoint");
log_e("Failed to create Fan endpoint");
return false;
}

Expand Down Expand Up @@ -152,7 +152,7 @@ bool MatterFan::setMode(FanMode_t newMode, bool performUpdate) {
return true;
}

// this function will change the Fan Speed by callin the user application callback
// this function will change the Fan Speed by calling the user application callback
// it is up to the application to decide to turn on, off or change the speed of the fan
bool MatterFan::setSpeedPercent(uint8_t newPercent, bool performUpdate) {
if (!started) {
Expand Down

0 comments on commit dadf2c2

Please sign in to comment.