Skip to content

Commit

Permalink
fix: gracefully handle devices that don't support child_lock
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlb committed Aug 10, 2024
1 parent 0cdc3d5 commit eae9e45
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/blueair_api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ async def refresh(self):
self.brightness = int(attributes["brightness"])
else:
self.brightness = 0
self.child_lock = bool(attributes["child_lock"])
if "child_lock" in attributes:
self.child_lock = bool(attributes["child_lock"])
if "night_mode" in attributes:
self.night_mode = bool(attributes["night_mode"])
self.fan_speed = int(attributes["fan_speed"])
Expand Down

0 comments on commit eae9e45

Please sign in to comment.