blueair-api 1.9.6__tar.gz → 1.11.0__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.9.6 → blueair_api-1.11.0}/PKG-INFO +1 -1
- {blueair_api-1.9.6 → blueair_api-1.11.0}/pyproject.toml +2 -2
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/const.py +5 -6
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/device_aws.py +34 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/util_bootstrap.py +5 -2
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api.egg-info/PKG-INFO +1 -1
- {blueair_api-1.9.6 → blueair_api-1.11.0}/LICENSE +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/README.md +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/setup.cfg +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/__init__.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/callbacks.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/device.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/errors.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/http_aws_blueair.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/http_blueair.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/stub.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/util.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api/util_http.py +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api.egg-info/SOURCES.txt +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api.egg-info/dependency_links.txt +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api.egg-info/requires.txt +0 -0
- {blueair_api-1.9.6 → blueair_api-1.11.0}/src/blueair_api.egg-info/top_level.txt +0 -0
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
|
|
8
8
|
|
9
9
|
[project]
|
10
10
|
name = "blueair_api"
|
11
|
-
version = "1.
|
11
|
+
version = "1.11.0"
|
12
12
|
authors = [
|
13
13
|
{ name="Brendan Dahl", email="dahl.brendan@gmail.com" },
|
14
14
|
]
|
@@ -35,4 +35,4 @@ keywords = [
|
|
35
35
|
|
36
36
|
[project.urls]
|
37
37
|
"Homepage" = "https://github.com/dahlb/blueair_api"
|
38
|
-
"Bug Tracker" = "https://github.com/dahlb/blueair_api/issues"
|
38
|
+
"Bug Tracker" = "https://github.com/dahlb/blueair_api/issues"
|
@@ -1,4 +1,3 @@
|
|
1
|
-
from typing import Union
|
2
1
|
from collections.abc import Mapping
|
3
2
|
from typing_extensions import TypedDict
|
4
3
|
|
@@ -11,12 +10,12 @@ SENSITIVE_FIELD_NAMES = [
|
|
11
10
|
# The BlueAir API uses a fixed API key.
|
12
11
|
API_KEY = "eyJhbGciOiJIUzI1NiJ9.eyJncmFudGVlIjoiYmx1ZWFpciIsImlhdCI6MTQ1MzEyNTYzMiwidmFsaWRpdHkiOi0xLCJqdGkiOiJkNmY3OGE0Yi1iMWNkLTRkZDgtOTA2Yi1kN2JkNzM0MTQ2NzQiLCJwZXJtaXNzaW9ucyI6WyJhbGwiXSwicXVvdGEiOi0xLCJyYXRlTGltaXQiOi0xfQ.CJsfWVzFKKDDA6rWdh-hjVVVE9S3d6Hu9BzXG9htWFw" # noqa: E501
|
13
12
|
|
14
|
-
MeasurementBundle = TypedDict(
|
15
|
-
"MeasurementBundle",
|
16
|
-
{"sensors": list[str], "datapoints": list[list[Union[int, float]]]},
|
17
|
-
)
|
18
13
|
|
19
|
-
|
14
|
+
class MeasurementBundle(TypedDict):
|
15
|
+
sensors: list[str]
|
16
|
+
datapoints: list[list[int | float]]
|
17
|
+
|
18
|
+
MeasurementList = list[Mapping[str, int | float]]
|
20
19
|
|
21
20
|
AWS_APIKEYS = {
|
22
21
|
"us": {
|
@@ -12,6 +12,9 @@ class DeviceAws(CallbacksMixin):
|
|
12
12
|
name: str = None
|
13
13
|
name_api: str = None
|
14
14
|
mac: str = None
|
15
|
+
type_name: str = None
|
16
|
+
|
17
|
+
sku: str = None
|
15
18
|
firmware: str = None
|
16
19
|
mcu_firmware: str = None
|
17
20
|
serial_number: str = None
|
@@ -33,20 +36,29 @@ class DeviceAws(CallbacksMixin):
|
|
33
36
|
filter_usage: int = None # percentage
|
34
37
|
wifi_working: bool = None
|
35
38
|
|
39
|
+
# i35
|
40
|
+
wick_usage: int = None # percentage
|
41
|
+
wick_dry_mode: bool = None
|
42
|
+
water_shortage: bool = None
|
43
|
+
auto_regulated_humidity: int = None
|
44
|
+
|
36
45
|
def __init__(
|
37
46
|
self,
|
38
47
|
api: HttpAwsBlueair,
|
39
48
|
uuid: str = None,
|
40
49
|
name_api: str = None,
|
41
50
|
mac: str = None,
|
51
|
+
type_name: str = None,
|
42
52
|
):
|
43
53
|
self.api = api
|
44
54
|
self.uuid = uuid
|
45
55
|
self.name_api = name_api
|
46
56
|
self.mac = mac
|
57
|
+
self.type_name = type_name
|
47
58
|
_LOGGER.debug(f"creating blueair device aws: {self.uuid}")
|
48
59
|
|
49
60
|
async def refresh(self):
|
61
|
+
_LOGGER.debug(f"refreshing blueair device aws: {self.uuid}")
|
50
62
|
info = await self.api.device_info(self.name_api, self.uuid)
|
51
63
|
sensor_data = convert_api_array_to_dict(info["sensordata"])
|
52
64
|
self.pm1 = safely_get_json_value(sensor_data, "pm1", int)
|
@@ -60,6 +72,7 @@ class DeviceAws(CallbacksMixin):
|
|
60
72
|
self.firmware = safely_get_json_value(info, "configuration.di.cfv")
|
61
73
|
self.mcu_firmware = safely_get_json_value(info, "configuration.di.mfv")
|
62
74
|
self.serial_number = safely_get_json_value(info, "configuration.di.ds")
|
75
|
+
self.sku = safely_get_json_value(info, "configuration.di.sku")
|
63
76
|
|
64
77
|
states = convert_api_array_to_dict(info["states"])
|
65
78
|
self.running = safely_get_json_value(states, "standby") is False
|
@@ -71,8 +84,13 @@ class DeviceAws(CallbacksMixin):
|
|
71
84
|
self.fan_auto_mode = safely_get_json_value(states, "automode", bool)
|
72
85
|
self.filter_usage = safely_get_json_value(states, "filterusage", int)
|
73
86
|
self.wifi_working = safely_get_json_value(states, "online", bool)
|
87
|
+
self.wick_usage = safely_get_json_value(states, "wickusage", int)
|
88
|
+
self.wick_dry_mode = safely_get_json_value(states, "wickdrys", bool)
|
89
|
+
self.auto_regulated_humidity = safely_get_json_value(states, "autorh", int)
|
90
|
+
self.water_shortage = safely_get_json_value(states, "wshortage", bool)
|
74
91
|
|
75
92
|
self.publish_updates()
|
93
|
+
_LOGGER.debug(f"refreshed blueair device aws: {self}")
|
76
94
|
|
77
95
|
async def set_brightness(self, value: int):
|
78
96
|
self.brightness = value
|
@@ -94,6 +112,11 @@ class DeviceAws(CallbacksMixin):
|
|
94
112
|
await self.api.set_device_info(self.uuid, "automode", "vb", fan_auto_mode)
|
95
113
|
self.publish_updates()
|
96
114
|
|
115
|
+
async def set_auto_regulated_humidity(self, value: int):
|
116
|
+
self.auto_regulated_humidity = value
|
117
|
+
await self.api.set_device_info(self.uuid, "autorh", "v", value)
|
118
|
+
self.publish_updates()
|
119
|
+
|
97
120
|
async def set_child_lock(self, child_lock: bool):
|
98
121
|
self.child_lock = child_lock
|
99
122
|
await self.api.set_device_info(self.uuid, "childlock", "vb", child_lock)
|
@@ -104,10 +127,17 @@ class DeviceAws(CallbacksMixin):
|
|
104
127
|
await self.api.set_device_info(self.uuid, "nightmode", "vb", night_mode)
|
105
128
|
self.publish_updates()
|
106
129
|
|
130
|
+
async def set_wick_dry_mode(self, value: bool):
|
131
|
+
self.wick_dry_mode = value
|
132
|
+
await self.api.set_device_info(self.uuid, "wickdrys", "vb", value)
|
133
|
+
self.publish_updates()
|
134
|
+
|
107
135
|
def __repr__(self):
|
108
136
|
return {
|
109
137
|
"uuid": self.uuid,
|
110
138
|
"name": self.name,
|
139
|
+
"type_name": self.type_name,
|
140
|
+
"sku": self.sku,
|
111
141
|
"name_api": self.name_api,
|
112
142
|
"mac": self.mac,
|
113
143
|
"firmware": self.firmware,
|
@@ -127,6 +157,10 @@ class DeviceAws(CallbacksMixin):
|
|
127
157
|
"temperature": self.temperature,
|
128
158
|
"humidity": self.humidity,
|
129
159
|
"filter_usage": self.filter_usage,
|
160
|
+
"wick_usage": self.wick_usage,
|
161
|
+
"wick_dry_mode": self.wick_dry_mode,
|
162
|
+
"auto_regulated_humidity": self.auto_regulated_humidity,
|
163
|
+
"water_shortage": self.water_shortage,
|
130
164
|
}
|
131
165
|
|
132
166
|
def __str__(self):
|
@@ -61,7 +61,10 @@ async def get_aws_devices(
|
|
61
61
|
uuid=device["uuid"],
|
62
62
|
name_api=device["name"],
|
63
63
|
mac=device["mac"],
|
64
|
+
type_name=device["type"],
|
64
65
|
)
|
65
66
|
|
66
|
-
|
67
|
-
|
67
|
+
|
68
|
+
devices = list(map(create_device, api_devices))
|
69
|
+
|
70
|
+
return (api, devices)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|