From 3dccc2016c4c7a1f399b0fc4e832e81f48859173 Mon Sep 17 00:00:00 2001 From: ollo69 Date: Sat, 13 Nov 2021 22:45:49 +0100 Subject: [PATCH] Use same duct set zone command for device V1 and V2 --- custom_components/smartthinq_sensors/wideq/ac.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/custom_components/smartthinq_sensors/wideq/ac.py b/custom_components/smartthinq_sensors/wideq/ac.py index b2306033..06422174 100644 --- a/custom_components/smartthinq_sensors/wideq/ac.py +++ b/custom_components/smartthinq_sensors/wideq/ac.py @@ -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)