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 GitHub
parent b4741c2069
commit 67a30d71e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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