From 7d465f323bfbc542e7010fa2bf364ca4c22a0161 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia Date: Mon, 16 Dec 2024 08:14:13 -0300 Subject: [PATCH] feat(matter): fix commentaries related to feature changes and log messages --- libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp | 4 ++-- .../src/MatterEndpoints/MatterColorTemperatureLight.cpp | 6 +++--- .../Matter/src/MatterEndpoints/MatterContactSensor.cpp | 2 +- .../Matter/src/MatterEndpoints/MatterDimmableLight.cpp | 4 ++-- .../src/MatterEndpoints/MatterEnhancedColorLight.cpp | 8 ++++---- libraries/Matter/src/MatterEndpoints/MatterFan.cpp | 6 +++--- .../Matter/src/MatterEndpoints/MatterHumiditySensor.cpp | 4 ++-- .../Matter/src/MatterEndpoints/MatterOccupancySensor.cpp | 2 +- libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp | 2 +- .../Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp | 2 +- .../Matter/src/MatterEndpoints/MatterPressureSensor.cpp | 2 +- .../src/MatterEndpoints/MatterTemperatureSensor.cpp | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp b/libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp index b67cf6a23..6e2a79104 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp @@ -206,7 +206,7 @@ bool MatterColorLight::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } @@ -256,7 +256,7 @@ bool MatterColorLight::setColorHSV(espHsvColor_t _hsvColor) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (colorHSV.h == _hsvColor.h && colorHSV.s == _hsvColor.s && colorHSV.v == _hsvColor.v) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp b/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp index 7bbcb83dc..f54203b79 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp @@ -138,7 +138,7 @@ bool MatterColorTemperatureLight::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } @@ -179,7 +179,7 @@ bool MatterColorTemperatureLight::setBrightness(uint8_t newBrightness) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (brightnessLevel == newBrightness) { return true; } @@ -210,7 +210,7 @@ bool MatterColorTemperatureLight::setColorTemperature(uint16_t newTemperature) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (colorTemperatureLevel == newTemperature) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterContactSensor.cpp b/libraries/Matter/src/MatterEndpoints/MatterContactSensor.cpp index 44ba1c75a..fb08587c6 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterContactSensor.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterContactSensor.cpp @@ -69,7 +69,7 @@ bool MatterContactSensor::setContact(bool _contactState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (contactState == _contactState) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp b/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp index c3991e0c0..cd9830be8 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp @@ -114,7 +114,7 @@ bool MatterDimmableLight::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } @@ -155,7 +155,7 @@ bool MatterDimmableLight::setBrightness(uint8_t newBrightness) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (brightnessLevel == newBrightness) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp b/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp index 423a6a7d2..215e52b41 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp @@ -226,7 +226,7 @@ bool MatterEnhancedColorLight::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } @@ -267,7 +267,7 @@ bool MatterEnhancedColorLight::setBrightness(uint8_t newBrightness) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (brightnessLevel == newBrightness) { return true; } @@ -298,7 +298,7 @@ bool MatterEnhancedColorLight::setColorTemperature(uint16_t newTemperature) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (colorTemperatureLevel == newTemperature) { return true; } @@ -338,7 +338,7 @@ bool MatterEnhancedColorLight::setColorHSV(espHsvColor_t _hsvColor) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (colorHSV.h == _hsvColor.h && colorHSV.s == _hsvColor.s && colorHSV.v == _hsvColor.v) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterFan.cpp b/libraries/Matter/src/MatterEndpoints/MatterFan.cpp index 8db6a317e..12de176d1 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterFan.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterFan.cpp @@ -118,7 +118,7 @@ bool MatterFan::setMode(FanMode_t newMode, bool performUpdate) { log_w("Matter Fan device has not begun."); return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (currentFanMode == newMode) { return true; } @@ -159,7 +159,7 @@ bool MatterFan::setSpeedPercent(uint8_t newPercent, bool performUpdate) { log_w("Matter Fan device has not begun."); return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (currentPercent == newPercent) { return true; } @@ -193,7 +193,7 @@ bool MatterFan::setOnOff(bool newState, bool performUpdate) { log_w("Matter Fan device has not begun."); return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (getOnOff() == newState) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.cpp b/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.cpp index 3e9116060..7526b99a7 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.cpp @@ -82,7 +82,7 @@ bool MatterHumiditySensor::setRawHumidity(uint16_t _rawHumidity) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (rawHumidity == _rawHumidity) { return true; } @@ -98,7 +98,7 @@ bool MatterHumiditySensor::setRawHumidity(uint16_t _rawHumidity) { bool ret; ret = updateAttributeVal(RelativeHumidityMeasurement::Id, RelativeHumidityMeasurement::Attributes::MeasuredValue::Id, &humidityVal); if (!ret) { - log_e("Failed to update Fan Speed Percent Attribute."); + log_e("Failed to update Humidity Sensor Attribute."); return false; } rawHumidity = _rawHumidity; diff --git a/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.cpp b/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.cpp index d893f14b6..ad200bc2a 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.cpp @@ -80,7 +80,7 @@ bool MatterOccupancySensor::setOccupancy(bool _occupancyState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (occupancyState == _occupancyState) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp b/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp index 3f71ff1eb..1071b595e 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp @@ -94,7 +94,7 @@ bool MatterOnOffLight::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp b/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp index 6b5e5e630..546da3b04 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp @@ -93,7 +93,7 @@ bool MatterOnOffPlugin::setOnOff(bool newState) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (onOffState == newState) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.cpp b/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.cpp index a157469c9..f246ea812 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterPressureSensor.cpp @@ -70,7 +70,7 @@ bool MatterPressureSensor::setRawPressure(int16_t _rawPressure) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (rawPressure == _rawPressure) { return true; } diff --git a/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.cpp b/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.cpp index 4a43650f9..6f59a5b24 100644 --- a/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.cpp +++ b/libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.cpp @@ -70,7 +70,7 @@ bool MatterTemperatureSensor::setRawTemperature(int16_t _rawTemperature) { return false; } - // avoid processing the a "no-change" + // avoid processing if there was no change if (rawTemperature == _rawTemperature) { return true; } @@ -86,7 +86,7 @@ bool MatterTemperatureSensor::setRawTemperature(int16_t _rawTemperature) { bool ret; ret = updateAttributeVal(TemperatureMeasurement::Id, TemperatureMeasurement::Attributes::MeasuredValue::Id, &temperatureVal); if (!ret) { - log_e("Failed to update Fan Speed Percent Attribute."); + log_e("Failed to update Temperature Sensor Attribute."); return false; } rawTemperature = _rawTemperature;