Fix HVAC mode duplication for Shelly Gen2 climate platform (#105812)

Fix HVAC mode duplication
This commit is contained in:
Maciej Bieniek 2023-12-15 18:14:53 +01:00 committed by Franck Nijhof
parent c5e3d922b0
commit b58c8eaaa9
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -419,7 +419,6 @@ class BlockSleepingClimate(
class RpcClimate(ShellyRpcEntity, ClimateEntity): class RpcClimate(ShellyRpcEntity, ClimateEntity):
"""Entity that controls a thermostat on RPC based Shelly devices.""" """Entity that controls a thermostat on RPC based Shelly devices."""
_attr_hvac_modes = [HVACMode.OFF]
_attr_icon = "mdi:thermostat" _attr_icon = "mdi:thermostat"
_attr_max_temp = RPC_THERMOSTAT_SETTINGS["max"] _attr_max_temp = RPC_THERMOSTAT_SETTINGS["max"]
_attr_min_temp = RPC_THERMOSTAT_SETTINGS["min"] _attr_min_temp = RPC_THERMOSTAT_SETTINGS["min"]
@ -435,9 +434,9 @@ class RpcClimate(ShellyRpcEntity, ClimateEntity):
"type", "heating" "type", "heating"
) )
if self._thermostat_type == "cooling": if self._thermostat_type == "cooling":
self._attr_hvac_modes.append(HVACMode.COOL) self._attr_hvac_modes = [HVACMode.OFF, HVACMode.COOL]
else: else:
self._attr_hvac_modes.append(HVACMode.HEAT) self._attr_hvac_modes = [HVACMode.OFF, HVACMode.HEAT]
@property @property
def target_temperature(self) -> float | None: def target_temperature(self) -> float | None: