blueair-api 1.31.0__py3-none-any.whl → 1.31.2__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.
blueair_api/device.py CHANGED
@@ -1,14 +1,13 @@
1
- import dataclasses
2
- import logging
3
-
4
1
  from .callbacks import CallbacksMixin
5
2
  from .http_blueair import HttpBlueair
6
3
  from .util import transform_data_points, safely_get_json_value
4
+ from dataclasses import dataclass, field
5
+ from logging import getLogger
7
6
 
8
- _LOGGER = logging.getLogger(__name__)
7
+ _LOGGER = getLogger(__name__)
9
8
 
10
9
 
11
- @dataclasses.dataclass(slots=True)
10
+ @dataclass(slots=True)
12
11
  class Device(CallbacksMixin):
13
12
  @classmethod
14
13
  async def create_device(cls, api, uuid, name, mac, refresh=False):
@@ -32,7 +31,9 @@ class Device(CallbacksMixin):
32
31
  _LOGGER.debug(f"create_device blueair device: {device}")
33
32
  return device
34
33
 
35
- api: HttpBlueair
34
+ api: HttpBlueair = field(repr=False)
35
+ raw_info : dict[str: any] = field(repr=False, init=False)
36
+
36
37
  uuid: str | None = None
37
38
  name: str | None = None
38
39
  timezone: str | None = None
@@ -63,7 +64,9 @@ class Device(CallbacksMixin):
63
64
 
64
65
  async def refresh(self):
65
66
  _LOGGER.debug("Requesting current attributes...")
67
+ self.raw_info = {}
66
68
  attributes = await self.api.get_attributes(self.uuid)
69
+ self.raw_info["attributes"] = attributes
67
70
  _LOGGER.debug(f"result: {attributes}")
68
71
  if "brightness" in attributes:
69
72
  self.brightness = int(attributes["brightness"])
@@ -94,7 +97,9 @@ class Device(CallbacksMixin):
94
97
  else:
95
98
  self.wifi_working = False
96
99
  if self.compatibility != "sense+":
97
- for data_point in transform_data_points(await self.api.get_data_points_since(self.uuid)):
100
+ datapoints = transform_data_points(await self.api.get_data_points_since(self.uuid))
101
+ self.raw_info["datapoints"] = datapoints
102
+ for data_point in datapoints:
98
103
  _LOGGER.debug(data_point)
99
104
  self.pm25 = safely_get_json_value(data_point, "pm25", int)
100
105
  self.pm10 = safely_get_json_value(data_point, "pm10", int)
blueair_api/device_aws.py CHANGED
@@ -28,7 +28,7 @@ class DeviceAws(CallbacksMixin):
28
28
  _LOGGER.debug(f"create_device blueair device_aws: {device_aws}")
29
29
  return device_aws
30
30
 
31
- api: HttpAwsBlueair
31
+ api: HttpAwsBlueair = field(repr=False)
32
32
  raw_info : dict[str: any] = field(repr=False, init=False)
33
33
 
34
34
  uuid : str | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blueair_api
3
- Version: 1.31.0
3
+ Version: 1.31.2
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
@@ -1,8 +1,8 @@
1
1
  blueair_api/__init__.py,sha256=GucsIENhTF4AVxPn4Xyr4imUxJJ8RO8RYt1opHCF2hQ,326
2
2
  blueair_api/callbacks.py,sha256=fvrJsqH5eDRxWOGWiZkF2uLU4n2ve0zzU17ERqWbHP8,756
3
3
  blueair_api/const.py,sha256=q1smSEhwyYvuQiR867lToFm-mGV-d3dNJvN0NJgscbU,1037
4
- blueair_api/device.py,sha256=5aXf3uLcxt9SHiay9QAq1cf9gUIayDod8m23WSYzXz4,4833
5
- blueair_api/device_aws.py,sha256=pf800jUwL6n0aEsDOXLgULBWDSkY4schkbRmfJ---IE,7257
4
+ blueair_api/device.py,sha256=1Ey4Y2S0qu-ubYCixmbZOwzFBxXVXHSlk4qIUUgFYm0,5097
5
+ blueair_api/device_aws.py,sha256=UZjtG6IcC2YzEX8jbS6Vp4fmBXYicbKZKP8nD9Pc--g,7277
6
6
  blueair_api/errors.py,sha256=lJ_iFU_W6zQfGRi_wsMhWDw-fAVPFeCkCbT1erIlYQQ,233
7
7
  blueair_api/http_aws_blueair.py,sha256=jztGyoH0iC7aCJ2oGf9hnEeHFOie3YikFvwtWo3W2w4,8536
8
8
  blueair_api/http_blueair.py,sha256=IMnKXs9S0Z-t1GVshSItjNr9tTdtXjh7-T-tHpsbzhE,11752
@@ -12,8 +12,8 @@ blueair_api/stub.py,sha256=tWJJLIhKf39P1gRAXfJk6L8cBJI9fVK3Uk9pj2_Teaw,1187
12
12
  blueair_api/util.py,sha256=7MrB2DLqUVOlBQuhv7bRmUXvcGcsjXiV3M0H3LloiOo,1962
13
13
  blueair_api/util_bootstrap.py,sha256=oo6qqEYUxWb4wLLivk7ofB0YFrKsTZo5tW0U2wc3-D0,1757
14
14
  blueair_api/util_http.py,sha256=45AJG3Vb6LMVzI0WV22AoSyt64f_Jj3KpOAwF5M6EFE,1327
15
- blueair_api-1.31.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
16
- blueair_api-1.31.0.dist-info/METADATA,sha256=fHRrOZGzigB-iWQVwhowze3bO5FjfLLLAvnwPzBEcI0,1995
17
- blueair_api-1.31.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
- blueair_api-1.31.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
19
- blueair_api-1.31.0.dist-info/RECORD,,
15
+ blueair_api-1.31.2.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
16
+ blueair_api-1.31.2.dist-info/METADATA,sha256=bMSWj-D7sutJJyPxGH19ke_aOla4qgG8yKRmrLU48aM,1995
17
+ blueair_api-1.31.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ blueair_api-1.31.2.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
19
+ blueair_api-1.31.2.dist-info/RECORD,,