From 5beec4d43caa8b1f91e387d3032685ece002e570 Mon Sep 17 00:00:00 2001 From: William Date: Sat, 11 May 2024 17:59:40 -0400 Subject: [PATCH] lets try this --- custom_components/localtuya/climate.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/custom_components/localtuya/climate.py b/custom_components/localtuya/climate.py index fc6fac1..c14c369 100644 --- a/custom_components/localtuya/climate.py +++ b/custom_components/localtuya/climate.py @@ -213,6 +213,10 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity): self._conf_hvac_mode_set = HVAC_MODE_SETS.get( self._config.get(CONF_HVAC_MODE_SET), {} ) + + self._conf_hvac_onoff_separate = self._config.get(CONF_HVAC_ONOFF_SEPARATE) + self._conf_hvac_onoff_dp = self._config.get(CONF_HVAC_ONOFF_DP) + self._conf_hvac_fan_mode_dp = self._config.get(CONF_HVAC_FAN_MODE_DP) self._conf_hvac_fan_mode_set = HVAC_FAN_MODE_SETS.get( self._config.get(CONF_HVAC_FAN_MODE_SET), {} @@ -387,6 +391,11 @@ class LocaltuyaClimate(LocalTuyaEntity, ClimateEntity): if hvac_mode == HVACMode.OFF: await self._device.set_dp(False, self._dp_id) return + if self._conf_hvac_onoff_separate: + if hvac_mode == HVACMode.OFF: + await self._device.set_dp(False, self._conf_hvac_onoff_dp) + else: + await self._device.set_dp(True, self._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