From 9019ecd56e2be5077736090df5a5b905af26a6e6 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 18 Apr 2024 04:36:23 -0400 Subject: [PATCH] fix: handle models that are missing filter_status --- src/blueair_api/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blueair_api/device.py b/src/blueair_api/device.py index d42c039..263fa7e 100644 --- a/src/blueair_api/device.py +++ b/src/blueair_api/device.py @@ -61,7 +61,10 @@ async def refresh(self): if "night_mode" in attributes: self.night_mode = bool(attributes["night_mode"]) self.fan_speed = int(attributes["fan_speed"]) - self.filter_expired = attributes["filter_status"] != "OK" + if "filter_status": + self.filter_expired = attributes["filter_status"] != "OK" + else: + self.filter_expired = None self.fan_mode = attributes["mode"] if "wifi_status" in attributes: self.wifi_working = attributes["wifi_status"] == "1"