Skip to content

Commit

Permalink
fix: don't propagate bow_id to devices that don't exist (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptk committed May 27, 2023
1 parent 0a87a92 commit f6e518f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyomnilogic_local/models/mspconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ def propagate_bow_id(self, bow_id: int | None) -> None:
if isinstance(subdevice, list):
for device in subdevice:
# ... then call propagate_bow_id on each of them ...
device.propagate_bow_id(bow_id)
if device is not None:
device.propagate_bow_id(bow_id)
else:
# ... otherwise just call it on the single subdevice
subdevice.propagate_bow_id(bow_id)
if subdevice is not None:
subdevice.propagate_bow_id(bow_id)


class MSPSystem(BaseModel):
Expand Down

0 comments on commit f6e518f

Please sign in to comment.