Skip to content

Commit b483008

Browse files
committed
feat: for non-aws devices set missing attributes from api to not implemented
1 parent 04dac1a commit b483008

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/blueair_api/device.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,27 @@ async def refresh(self):
6868
if "brightness" in attributes:
6969
self.brightness = int(attributes["brightness"])
7070
else:
71-
self.brightness = 0
71+
self.brightness = NotImplemented
7272
if "child_lock" in attributes:
7373
self.child_lock = attributes["child_lock"] == "1"
74+
else:
75+
self.child_lock = NotImplemented
7476
if "night_mode" in attributes:
7577
self.night_mode = attributes["night_mode"] == "1"
76-
self.fan_speed = int(attributes["fan_speed"])
78+
else:
79+
self.night_mode = NotImplemented
80+
if "fan_speed" in attributes:
81+
self.fan_speed = int(attributes["fan_speed"])
82+
else:
83+
self.fan_speed = NotImplemented
7784
if "filter_status" in attributes:
7885
self.filter_expired = attributes["filter_status"] != "OK"
79-
self.fan_mode = attributes["mode"]
86+
else:
87+
self.filter_expired = NotImplemented
88+
if "mode" in attributes:
89+
self.fan_mode = attributes["mode"]
90+
else:
91+
self.fan_mode = NotImplemented
8092
if "wifi_status" in attributes:
8193
self.wifi_working = attributes["wifi_status"] == "1"
8294
else:

0 commit comments

Comments
 (0)