Skip to content

Commit

Permalink
Merge pull request #206 from MTrab:Fix-invalid-zone-detection
Browse files Browse the repository at this point in the history
Fix invalid zone detection
  • Loading branch information
MTrab authored Apr 16, 2024
2 parents e66009b + 9a88283 commit 0b53cc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyworxcloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,10 @@ def setzone(self, serial_number: str, zone: str | int) -> None:
if not isinstance(zone, int):
zone = int(zone)

if device.zone["starting_point"][zone] == 0:
if (
zone not in device.zone["starting_point"]
or device.zone["starting_point"][zone] == 0
):
raise ZoneNotDefined("Cannot request this zone as it is not defined.")

if not zone in device.zone["indicies"]:
Expand Down

0 comments on commit 0b53cc9

Please sign in to comment.