Skip to content

Commit

Permalink
fix: childlock should be bool, more session debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlb committed Sep 23, 2024
1 parent cd684ac commit cfd636f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/blueair_api/device_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/blueair_api/http_aws_blueair.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cfd636f

Please sign in to comment.