From 08497db358684e07d37067a3a288bc90350f6e45 Mon Sep 17 00:00:00 2001 From: Nils Bergmann Date: Tue, 27 Feb 2024 14:32:23 +0100 Subject: [PATCH] Extend ZHA thermostat local temperature calibration range for Sonoff TRVZB (#109691) * Extend thermostat local temperature calibration range * Extend thermostat local temperature calibration range only for TRVZB * Change _attr_native_min_value and _attr_native_max_value back to -2.5 and 2.5 * Adjust _attr_native_step for TRVZB to 0.2 * Implement requested changes * Fix platform for MULTI_MATCH * Implement requested changes * Implement requested changes --- homeassistant/components/zha/number.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zha/number.py b/homeassistant/components/zha/number.py index 2b6a64edf69..a4568b5a14c 100644 --- a/homeassistant/components/zha/number.py +++ b/homeassistant/components/zha/number.py @@ -953,7 +953,10 @@ class AqaraThermostatAwayTemp(ZHANumberConfigurationEntity): _attr_icon: str = ICONS[0] -@CONFIG_DIAGNOSTIC_MATCH(cluster_handler_names=CLUSTER_HANDLER_THERMOSTAT) +@CONFIG_DIAGNOSTIC_MATCH( + cluster_handler_names=CLUSTER_HANDLER_THERMOSTAT, + stop_on_match_group=CLUSTER_HANDLER_THERMOSTAT, +) # pylint: disable-next=hass-invalid-inheritance # needs fixing class ThermostatLocalTempCalibration(ZHANumberConfigurationEntity): """Local temperature calibration.""" @@ -971,6 +974,20 @@ class ThermostatLocalTempCalibration(ZHANumberConfigurationEntity): _attr_icon: str = ICONS[0] +@CONFIG_DIAGNOSTIC_MATCH( + cluster_handler_names=CLUSTER_HANDLER_THERMOSTAT, + models={"TRVZB"}, + stop_on_match_group=CLUSTER_HANDLER_THERMOSTAT, +) +# pylint: disable-next=hass-invalid-inheritance # needs fixing +class SonoffThermostatLocalTempCalibration(ThermostatLocalTempCalibration): + """Local temperature calibration for the Sonoff TRVZB.""" + + _attr_native_min_value: float = -7 + _attr_native_max_value: float = 7 + _attr_native_step: float = 0.2 + + @CONFIG_DIAGNOSTIC_MATCH( cluster_handler_names=CLUSTER_HANDLER_OCCUPANCY, models={"SNZB-06P"} )