diff --git a/custom_components/vivint/climate.py b/custom_components/vivint/climate.py index 22b051b..ac92398 100644 --- a/custom_components/vivint/climate.py +++ b/custom_components/vivint/climate.py @@ -123,8 +123,11 @@ class VivintClimate(VivintEntity, ClimateEntity): ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE | ClimateEntityFeature.FAN_MODE + | ClimateEntityFeature.TURN_ON + | ClimateEntityFeature.TURN_OFF ) _attr_temperature_unit = UnitOfTemperature.CELSIUS + _enable_turn_on_off_backwards_compatibility = False def __init__(self, device: Thermostat, hub: VivintHub) -> None: """Pass coordinator to CoordinatorEntity.""" @@ -216,6 +219,14 @@ async def async_set_hvac_mode(self, hvac_mode: str) -> None: **{ThermostatAttribute.OPERATING_MODE: VIVINT_HVAC_INV_MODE_MAP[hvac_mode]} ) + async def async_turn_on(self) -> None: + """Turn the entity on.""" + await self.async_set_hvac_mode(HVACMode.HEAT_COOL) + + async def async_turn_off(self) -> None: + """Turn the entity off.""" + await self.async_set_hvac_mode(HVACMode.OFF) + async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" temp = kwargs.get(ATTR_TEMPERATURE)