Hardware
N/A - static code review finding, reproducible by inspection on any Matter-capable board (e.g. Arduino Nano Matter)
Core version
main / 4.0.0
Arduino IDE version
N/A
Operating system
N/A
Radio stack variant
Matter
OpenThread Border Router device (if using Matter)
N/A
Issue description
DeviceThermostat is constructed with raw local temperature/heating setpoint
values of 20 (MatterThermostat.cpp:93), which is 0.2°C - below both
abs_min_heating_setpoint (700 = 7°C) and min_heating_setpoint
(1600 = 16°C) initialized right below in the same constructor
(DeviceThermostat.cpp:36-39). This mirrors a bug just fixed for
MatterWaterHeater in PR #181 - the intended value was very likely
2000 (20°C), not 20 (0.2°C).
Separately, DeviceThermostat::SetHeatingSetpointValue()
(DeviceThermostat.cpp:66) only clamps against abs_min_heating_setpoint/
abs_max_heating_setpoint, ignoring the writable
min_heating_setpoint/max_heating_setpoint limits, and computes the
changed flag before clamping, which can fire a spurious attribute
report when an out-of-range write clamps back to the current value.
Suggested fix (same pattern applied to MatterWaterHeater in PR #181):
- Use a valid initial heating setpoint (e.g. within [min_heating_setpoint, max_heating_setpoint])
- Clamp against min_heating_setpoint/max_heating_setpoint instead of the absolute limits
- Compute
changed after clamping
Serial output
No response
RTT output (if using Matter)
No response
Minimal reproducer code
No response
Hardware
N/A - static code review finding, reproducible by inspection on any Matter-capable board (e.g. Arduino Nano Matter)
Core version
main / 4.0.0
Arduino IDE version
N/A
Operating system
N/A
Radio stack variant
Matter
OpenThread Border Router device (if using Matter)
N/A
Issue description
DeviceThermostatis constructed with raw local temperature/heating setpointvalues of
20(MatterThermostat.cpp:93), which is 0.2°C - below bothabs_min_heating_setpoint(700 = 7°C) andmin_heating_setpoint(1600 = 16°C) initialized right below in the same constructor
(DeviceThermostat.cpp:36-39). This mirrors a bug just fixed for
MatterWaterHeater in PR #181 - the intended value was very likely
2000 (20°C), not 20 (0.2°C).
Separately,
DeviceThermostat::SetHeatingSetpointValue()(DeviceThermostat.cpp:66) only clamps against
abs_min_heating_setpoint/abs_max_heating_setpoint, ignoring the writablemin_heating_setpoint/max_heating_setpointlimits, and computes thechangedflag before clamping, which can fire a spurious attributereport when an out-of-range write clamps back to the current value.
Suggested fix (same pattern applied to MatterWaterHeater in PR #181):
changedafter clampingSerial output
No response
RTT output (if using Matter)
No response
Minimal reproducer code
No response