Skip to content

Commit

Permalink
Set dp_id True only if the device is off. #235
Browse files Browse the repository at this point in the history
* This is an attempt to fix a device that sometiems refuse to change HVAC instantly
  • Loading branch information
xZetsubou committed May 16, 2024
1 parent d64fc68 commit fcc6911
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/localtuya/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ async def async_set_fan_mode(self, fan_mode):

async def async_set_hvac_mode(self, hvac_mode):
"""Set new target operation mode."""
new_states = {self._dp_id: hvac_mode != HVACMode.OFF}
new_states = {}
if not self._state:
new_states[self._dp_id] = True
if hvac_mode in self._hvac_mode_set:
new_states[self._hvac_mode_dp] = self._hvac_mode_set[hvac_mode]

Expand Down

0 comments on commit fcc6911

Please sign in to comment.