Skip to content

Commit

Permalink
Use same duct set zone command for device V1 and V2
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Nov 13, 2021
1 parent 4b85ec2 commit 3dccc20
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions custom_components/smartthinq_sensors/wideq/ac.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,9 @@ def _set_duct_zones(self, zones: dict):
_LOGGER.warning("Turn off all duct zones is not allowed")
return

if self._should_poll:
zone_cmd = "/".join(
f"{key}_{value[ZONE_ST_CUR]}"
for key, value in zones.items()
)
else:
bits = [v[ZONE_ST_CUR] for v in zones.values()]
zone_cmd = str(int("".join(v for v in reversed(bits)), 2))

zone_cmd = "/".join(
f"{key}_{value[ZONE_ST_CUR]}" for key, value in zones.items()
)
keys = self._get_cmd_keys(CMD_STATE_DUCT_ZONES)
self.set(keys[0], keys[1], key=keys[2], value=zone_cmd)

Expand Down

0 comments on commit 3dccc20

Please sign in to comment.