From 65f61925c9b654870a06089a221ee72bff1042ac Mon Sep 17 00:00:00 2001 From: William Date: Sat, 11 May 2024 08:54:27 -0400 Subject: [PATCH] add onoff logic --- custom_components/localtuya/climate.py | 6 ++++++ custom_components/localtuya/translations/it.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/custom_components/localtuya/climate.py b/custom_components/localtuya/climate.py index fc6fac1..6949593 100644 --- a/custom_components/localtuya/climate.py +++ b/custom_components/localtuya/climate.py @@ -387,6 +387,12 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity): if hvac_mode == HVACMode.OFF: await self._device.set_dp(False, self._dp_id) return + if self._config[CONF_HVAC_ONOFF_SEPARATE]: + if hvac_mode == HVACMode.OFF: + await self._device.set_dp(False, self._config[CONF_HVAC_ONOFF_DP]) + return + else: + await self._device.set_dp(True, self._config[CONF_HVAC_ONOFF_DP]) if not self._state and self._conf_hvac_mode_dp != self._dp_id: await self._device.set_dp(True, self._dp_id) # Some thermostats need a small wait before sending another update diff --git a/custom_components/localtuya/translations/it.json b/custom_components/localtuya/translations/it.json index 930a1a6..4f79389 100644 --- a/custom_components/localtuya/translations/it.json +++ b/custom_components/localtuya/translations/it.json @@ -178,7 +178,7 @@ "hvac_mode_dp": "Modalità HVAC attuale (opzionale)", "hvac_mode_set": "Impostazione modalità HVAC (opzionale)", "hvac_onoff_separate": "Il dispositivo dispone di DP ON/OFF separato dalle modalità HVAC", - "hvac_onoff_dp":"ACCESO/SPENTO DP", + "hvac_onoff_dp":"ON/OFF DP", "hvac_action_dp": "Azione HVAC attuale (opzionale)", "hvac_action_set": "Impostazione azione HVAC (opzionale)", "preset_dp": "Preset DP (opzionale)",