Skip to content

Commit

Permalink
Check zone arguments are of type Zone
Browse files Browse the repository at this point in the history
  • Loading branch information
crowbarz committed Jan 4, 2025
1 parent dbb7d8f commit c20a82d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aiopioneer/pioneer_avr.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ def _get_parameter_key_from_value(

def _check_zone(self, zone: Zone) -> Zone:
"""Check that specified zone is valid."""
if not isinstance(zone, Zone):
raise ValueError(f"{zone} is not a zone identifier")
if zone not in self.properties.zones:
raise ValueError(f"{zone.full_name} does not exist on AVR")
return zone
Expand Down

0 comments on commit c20a82d

Please sign in to comment.