diff --git a/src/blueair_api/device.py b/src/blueair_api/device.py index 942968d..53e3b27 100644 --- a/src/blueair_api/device.py +++ b/src/blueair_api/device.py @@ -20,6 +20,7 @@ class Device(CallbacksMixin): brightness: int = None child_lock: bool = None + night_mode: bool = None fan_speed: int = None fan_mode: str = None filter_expired: bool = None @@ -57,6 +58,7 @@ async def refresh(self): else: self.brightness = 0 self.child_lock = bool(attributes["child_lock"]) + self.night_mode = bool(attributes["night_mode"]) self.fan_speed = int(attributes["fan_speed"]) self.filter_expired = attributes["filter_status"] != "OK" self.fan_mode = attributes["mode"] @@ -83,6 +85,7 @@ def __repr__(self): "room_location": self.room_location, "brightness": self.brightness, "child_lock": self.child_lock, + "night_mode": self.night_mode, "fan_speed": self.fan_speed, "filter_expired": self.filter_expired, "fan_mode": self.fan_mode, diff --git a/src/blueair_api/device_aws.py b/src/blueair_api/device_aws.py index 5a26005..056f908 100644 --- a/src/blueair_api/device_aws.py +++ b/src/blueair_api/device_aws.py @@ -99,6 +99,11 @@ async def set_child_lock(self, child_lock: bool): await self.api.set_device_info(self.uuid, "childlock", "vb", child_lock) self.publish_updates() + async def set_night_mode(self, night_mode: bool): + self.night_mode = night_mode + await self.api.set_device_info(self.uuid, "nightmode", "vb", night_mode) + self.publish_updates() + def __repr__(self): return { "uuid": self.uuid,