Skip to content

Commit eae9e45

Browse files
committed
fix: gracefully handle devices that don't support child_lock
1 parent 0cdc3d5 commit eae9e45

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/blueair_api/device.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ async def refresh(self):
5757
self.brightness = int(attributes["brightness"])
5858
else:
5959
self.brightness = 0
60-
self.child_lock = bool(attributes["child_lock"])
60+
if "child_lock" in attributes:
61+
self.child_lock = bool(attributes["child_lock"])
6162
if "night_mode" in attributes:
6263
self.night_mode = bool(attributes["night_mode"])
6364
self.fan_speed = int(attributes["fan_speed"])

0 commit comments

Comments
 (0)