feat(matter): fix commentaries related to feature changes and log messages
This commit is contained in:
parent
31dc520c4d
commit
7d465f323b
12 changed files with 23 additions and 23 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue