From cfd636f08a31d8c62bba30b61c77cc98ec11cf8a Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Mon, 23 Sep 2024 16:58:38 -0400 Subject: [PATCH] fix: childlock should be bool, more session debug logging --- src/blueair_api/device_aws.py | 4 ++-- src/blueair_api/http_aws_blueair.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blueair_api/device_aws.py b/src/blueair_api/device_aws.py index 056f908..317fea8 100644 --- a/src/blueair_api/device_aws.py +++ b/src/blueair_api/device_aws.py @@ -17,7 +17,7 @@ class DeviceAws(CallbacksMixin): serial_number: str = None brightness: int = None - child_lock: int = None + child_lock: bool = None fan_speed: int = None fan_auto_mode: bool = None running: bool = None @@ -66,7 +66,7 @@ async def refresh(self): self.night_mode = safely_get_json_value(states, "nightmode", bool) self.germ_shield = safely_get_json_value(states, "germshield", bool) self.brightness = safely_get_json_value(states, "brightness", int) - self.child_lock = safely_get_json_value(states, "childlock") + self.child_lock = safely_get_json_value(states, "childlock", bool) self.fan_speed = safely_get_json_value(states, "fanspeed", int) self.fan_auto_mode = safely_get_json_value(states, "automode", bool) self.filter_usage = safely_get_json_value(states, "filterusage", int) diff --git a/src/blueair_api/http_aws_blueair.py b/src/blueair_api/http_aws_blueair.py index 5a68a21..32644e7 100644 --- a/src/blueair_api/http_aws_blueair.py +++ b/src/blueair_api/http_aws_blueair.py @@ -48,8 +48,10 @@ async def request_with_errors_wrapper(*args, **kwargs): url = kwargs["url"] response_text = await response.text() if "accounts.login" in url: + _LOGGER.debug("login error") raise LoginError(response_text) else: + _LOGGER.debug("session error") raise SessionError(response_text) return request_with_errors_wrapper