blueair-api 1.31.0__tar.gz → 1.31.2__tar.gz
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-1.31.0 → blueair_api-1.31.2}/PKG-INFO +1 -1
- {blueair_api-1.31.0 → blueair_api-1.31.2}/pyproject.toml +1 -1
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/device.py +12 -7
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/device_aws.py +1 -1
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api.egg-info/PKG-INFO +1 -1
- {blueair_api-1.31.0 → blueair_api-1.31.2}/LICENSE +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/README.md +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/setup.cfg +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/__init__.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/callbacks.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/const.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/errors.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/http_aws_blueair.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/http_blueair.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/intermediate_representation_aws.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/model_enum.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/stub.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/util.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/util_bootstrap.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/util_http.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api.egg-info/SOURCES.txt +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api.egg-info/dependency_links.txt +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api.egg-info/requires.txt +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api.egg-info/top_level.txt +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/tests/test_device_aws.py +0 -0
- {blueair_api-1.31.0 → blueair_api-1.31.2}/tests/test_intermediate_representation_aws.py +0 -0
@@ -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 =
|
7
|
+
_LOGGER = getLogger(__name__)
|
9
8
|
|
10
9
|
|
11
|
-
@
|
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
|
-
|
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)
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blueair_api-1.31.0 → blueair_api-1.31.2}/src/blueair_api/intermediate_representation_aws.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|