From c7ee5fdb78c7d31060c9304cf75eaa8317606b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Villagra?= Date: Thu, 13 Jan 2022 17:15:49 -0300 Subject: [PATCH] add turn on/off method --- custom_components/localtuya/climate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_components/localtuya/climate.py b/custom_components/localtuya/climate.py index 2e78d4f..7b03f31 100644 --- a/custom_components/localtuya/climate.py +++ b/custom_components/localtuya/climate.py @@ -313,6 +313,14 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity): self._conf_hvac_mode_set[hvac_mode], self._conf_hvac_mode_dp ) + async def async_turn_on(self) -> None: + """Turn the entity on.""" + await self._device.set_dp(True, self._dp_id) + + async def async_turn_off(self) -> None: + """Turn the entity off.""" + await self._device.set_dp(False, self._dp_id) + async def async_set_preset_mode(self, preset_mode): """Set new target preset mode.""" if preset_mode == PRESET_ECO: