From eae9e45b7af86b1cd8e4975c431fb0aaa8e7fa05 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Sat, 10 Aug 2024 07:59:46 -0400 Subject: [PATCH] fix: gracefully handle devices that don't support child_lock --- src/blueair_api/device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blueair_api/device.py b/src/blueair_api/device.py index 263fa7e..62d19e4 100644 --- a/src/blueair_api/device.py +++ b/src/blueair_api/device.py @@ -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"])