blueair-api 1.36.3__py3-none-any.whl → 1.36.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,9 +39,10 @@ def request_with_errors(func):
39
39
  status_code = response.status
40
40
  try:
41
41
  response_json = await response.json(content_type=None)
42
- if "statusCode" in response_json:
43
- _LOGGER.debug("response json found, checking status code from response")
44
- status_code = response_json["statusCode"]
42
+ if response_json is not None:
43
+ if "statusCode" in response_json:
44
+ _LOGGER.debug("response json found, checking status code from response")
45
+ status_code = response_json["statusCode"]
45
46
  except Exception as e:
46
47
  _LOGGER.error(f"Error parsing response for errors {e}")
47
48
  raise e
@@ -49,7 +50,7 @@ def request_with_errors(func):
49
50
  _LOGGER.debug("response 200")
50
51
  return response
51
52
  if 400 <= status_code <= 500:
52
- _LOGGER.debug("auth error")
53
+ _LOGGER.debug(f"auth error, {status_code}")
53
54
  url = kwargs["url"]
54
55
  response_text = await response.text()
55
56
  if "accounts.login" in url:
@@ -123,8 +123,12 @@ class SensorRecord:
123
123
 
124
124
  class SensorHistory(list[SensorRecord]):
125
125
  def __init__(self, response):
126
- sensors = response[0]["sensors"]
127
- datapoints = response[0]["datapoints"]
126
+ if response is None:
127
+ sensors = []
128
+ datapoints = []
129
+ else:
130
+ sensors = response[0]["sensors"]
131
+ datapoints = response[0]["datapoints"]
128
132
  sensor_records = []
129
133
  for datapoint in datapoints:
130
134
  values = {}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: blueair_api
3
- Version: 1.36.3
3
+ Version: 1.36.4
4
4
  Summary: Blueair Api Wrapper
5
5
  Author-email: Brendan Dahl <dahl.brendan@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/dahlb/blueair_api
@@ -4,16 +4,16 @@ blueair_api/const.py,sha256=x-2ae2faZqsalYCuqA_ZpGSZSu0_x_rTrvikagnM9PU,1585
4
4
  blueair_api/device.py,sha256=4mjoYGOiVGi_yw5ZRnpgwSRcV9q68nseC6VgdCDyWAQ,5554
5
5
  blueair_api/device_aws.py,sha256=Ksc2QDJtntgNEJZfO3tVfHyGwDmnG9YTPZAoJ_UWQdk,10562
6
6
  blueair_api/errors.py,sha256=lJ_iFU_W6zQfGRi_wsMhWDw-fAVPFeCkCbT1erIlYQQ,233
7
- blueair_api/http_aws_blueair.py,sha256=4-qrtqYkXHejUhImyDisnLJ-6sDf_YZkzD_Nv-KcBUw,9450
7
+ blueair_api/http_aws_blueair.py,sha256=pjcrFz7wa_Jn53jo2z0wcpc1tV8rJs3M9jwKS6juWxE,9520
8
8
  blueair_api/http_blueair.py,sha256=IMnKXs9S0Z-t1GVshSItjNr9tTdtXjh7-T-tHpsbzhE,11752
9
- blueair_api/intermediate_representation_aws.py,sha256=g4S7TsRxJd4uh-0k8ByvgG36AXDiPPbDtlHn5ZOTk_A,7035
9
+ blueair_api/intermediate_representation_aws.py,sha256=lIvAAvro8UJlBD-kTOW8SNNGcKTuQ2Zp0bmi-MJt7P0,7139
10
10
  blueair_api/model_enum.py,sha256=gH82gAnnxnK7JFIHbfjkFXFA3p_hSmujvvuQ0GQyzm4,494
11
11
  blueair_api/stub.py,sha256=J1BXHUzRR4P32q9WkbucmMqzAjqxS722NSMK4TLZG8o,1176
12
12
  blueair_api/util.py,sha256=2FerJEliR4AQc8nBeAMXb7nyl-CPhUszaHxFcVq4p0s,2105
13
13
  blueair_api/util_bootstrap.py,sha256=oo6qqEYUxWb4wLLivk7ofB0YFrKsTZo5tW0U2wc3-D0,1757
14
14
  blueair_api/util_http.py,sha256=LohO13eBk7_MCfBRg3tMKjLklDTr87RC6Q8vLffwX1M,1464
15
- blueair_api-1.36.3.dist-info/licenses/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
16
- blueair_api-1.36.3.dist-info/METADATA,sha256=aHcdb1CCbfMZ37qxHAZTiWvn5vLR9AS3Ywn7xzL5OUM,2017
17
- blueair_api-1.36.3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
18
- blueair_api-1.36.3.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
19
- blueair_api-1.36.3.dist-info/RECORD,,
15
+ blueair_api-1.36.4.dist-info/licenses/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
16
+ blueair_api-1.36.4.dist-info/METADATA,sha256=QrtVZcFB9p6AxvjhI-qqXBS2DqdcnU4twMSG9UJLuYE,2017
17
+ blueair_api-1.36.4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
18
+ blueair_api-1.36.4.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
19
+ blueair_api-1.36.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5