blueair-api 1.10.0__py3-none-any.whl → 1.12.0__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/__init__.py +1 -0
- blueair_api/const.py +8 -8
- blueair_api/device.py +1 -1
- blueair_api/device_aws.py +17 -1
- blueair_api/model_enum.py +7 -0
- blueair_api/util_bootstrap.py +5 -3
- {blueair_api-1.10.0.dist-info → blueair_api-1.12.0.dist-info}/METADATA +1 -1
- blueair_api-1.12.0.dist-info/RECORD +18 -0
- {blueair_api-1.10.0.dist-info → blueair_api-1.12.0.dist-info}/WHEEL +1 -1
- blueair_api-1.10.0.dist-info/RECORD +0 -17
- {blueair_api-1.10.0.dist-info → blueair_api-1.12.0.dist-info}/LICENSE +0 -0
- {blueair_api-1.10.0.dist-info → blueair_api-1.12.0.dist-info}/top_level.txt +0 -0
blueair_api/__init__.py
CHANGED
blueair_api/const.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
from collections.abc import Mapping
|
2
2
|
from typing_extensions import TypedDict
|
3
3
|
|
4
|
-
|
5
4
|
SENSITIVE_FIELD_NAMES = [
|
6
5
|
"username",
|
7
6
|
"password",
|
@@ -10,13 +9,6 @@ SENSITIVE_FIELD_NAMES = [
|
|
10
9
|
# The BlueAir API uses a fixed API key.
|
11
10
|
API_KEY = "eyJhbGciOiJIUzI1NiJ9.eyJncmFudGVlIjoiYmx1ZWFpciIsImlhdCI6MTQ1MzEyNTYzMiwidmFsaWRpdHkiOi0xLCJqdGkiOiJkNmY3OGE0Yi1iMWNkLTRkZDgtOTA2Yi1kN2JkNzM0MTQ2NzQiLCJwZXJtaXNzaW9ucyI6WyJhbGwiXSwicXVvdGEiOi0xLCJyYXRlTGltaXQiOi0xfQ.CJsfWVzFKKDDA6rWdh-hjVVVE9S3d6Hu9BzXG9htWFw" # noqa: E501
|
12
11
|
|
13
|
-
|
14
|
-
class MeasurementBundle(TypedDict):
|
15
|
-
sensors: list[str]
|
16
|
-
datapoints: list[list[int | float]]
|
17
|
-
|
18
|
-
MeasurementList = list[Mapping[str, int | float]]
|
19
|
-
|
20
12
|
AWS_APIKEYS = {
|
21
13
|
"us": {
|
22
14
|
"gigyaRegion": "us1",
|
@@ -31,3 +23,11 @@ AWS_APIKEYS = {
|
|
31
23
|
"apiKey": "3_qRseYzrUJl1VyxvSJANalu_kNgQ83swB1B9uzgms58--5w1ClVNmrFdsDnWVQQCl",
|
32
24
|
},
|
33
25
|
}
|
26
|
+
|
27
|
+
|
28
|
+
class MeasurementBundle(TypedDict):
|
29
|
+
sensors: list[str]
|
30
|
+
datapoints: list[list[int | float]]
|
31
|
+
|
32
|
+
|
33
|
+
MeasurementList = list[Mapping[str, int | float]]
|
blueair_api/device.py
CHANGED
@@ -37,7 +37,7 @@ class Device(CallbacksMixin):
|
|
37
37
|
self.uuid = uuid
|
38
38
|
self.name = name
|
39
39
|
self.mac = mac
|
40
|
-
_LOGGER.debug(f"creating blueair device: {self
|
40
|
+
_LOGGER.debug(f"creating blueair device: {self}")
|
41
41
|
|
42
42
|
async def init(self):
|
43
43
|
info = await self.api.get_info(self.uuid)
|
blueair_api/device_aws.py
CHANGED
@@ -2,6 +2,7 @@ import logging
|
|
2
2
|
|
3
3
|
from .callbacks import CallbacksMixin
|
4
4
|
from .http_aws_blueair import HttpAwsBlueair
|
5
|
+
from .model_enum import ModelEnum
|
5
6
|
from .util import convert_api_array_to_dict, safely_get_json_value
|
6
7
|
|
7
8
|
_LOGGER = logging.getLogger(__name__)
|
@@ -12,6 +13,9 @@ class DeviceAws(CallbacksMixin):
|
|
12
13
|
name: str = None
|
13
14
|
name_api: str = None
|
14
15
|
mac: str = None
|
16
|
+
type_name: str = None
|
17
|
+
|
18
|
+
sku: str = None
|
15
19
|
firmware: str = None
|
16
20
|
mcu_firmware: str = None
|
17
21
|
serial_number: str = None
|
@@ -36,7 +40,7 @@ class DeviceAws(CallbacksMixin):
|
|
36
40
|
# i35
|
37
41
|
wick_usage: int = None # percentage
|
38
42
|
wick_dry_mode: bool = None
|
39
|
-
|
43
|
+
water_shortage: bool = None
|
40
44
|
auto_regulated_humidity: int = None
|
41
45
|
|
42
46
|
def __init__(
|
@@ -55,6 +59,7 @@ class DeviceAws(CallbacksMixin):
|
|
55
59
|
_LOGGER.debug(f"creating blueair device aws: {self.uuid}")
|
56
60
|
|
57
61
|
async def refresh(self):
|
62
|
+
_LOGGER.debug(f"refreshing blueair device aws: {self.uuid}")
|
58
63
|
info = await self.api.device_info(self.name_api, self.uuid)
|
59
64
|
sensor_data = convert_api_array_to_dict(info["sensordata"])
|
60
65
|
self.pm1 = safely_get_json_value(sensor_data, "pm1", int)
|
@@ -68,6 +73,7 @@ class DeviceAws(CallbacksMixin):
|
|
68
73
|
self.firmware = safely_get_json_value(info, "configuration.di.cfv")
|
69
74
|
self.mcu_firmware = safely_get_json_value(info, "configuration.di.mfv")
|
70
75
|
self.serial_number = safely_get_json_value(info, "configuration.di.ds")
|
76
|
+
self.sku = safely_get_json_value(info, "configuration.di.sku")
|
71
77
|
|
72
78
|
states = convert_api_array_to_dict(info["states"])
|
73
79
|
self.running = safely_get_json_value(states, "standby") is False
|
@@ -85,6 +91,7 @@ class DeviceAws(CallbacksMixin):
|
|
85
91
|
self.water_shortage = safely_get_json_value(states, "wshortage", bool)
|
86
92
|
|
87
93
|
self.publish_updates()
|
94
|
+
_LOGGER.debug(f"refreshed blueair device aws: {self}")
|
88
95
|
|
89
96
|
async def set_brightness(self, value: int):
|
90
97
|
self.brightness = value
|
@@ -126,11 +133,20 @@ class DeviceAws(CallbacksMixin):
|
|
126
133
|
await self.api.set_device_info(self.uuid, "wickdrys", "vb", value)
|
127
134
|
self.publish_updates()
|
128
135
|
|
136
|
+
@property
|
137
|
+
def model(self) -> ModelEnum:
|
138
|
+
if self.sku == "111633":
|
139
|
+
return ModelEnum.HUMIDIFIER_I35
|
140
|
+
if self.sku == "105826":
|
141
|
+
return ModelEnum.PROTECT_7470I
|
142
|
+
return ModelEnum.UNKNOWN
|
143
|
+
|
129
144
|
def __repr__(self):
|
130
145
|
return {
|
131
146
|
"uuid": self.uuid,
|
132
147
|
"name": self.name,
|
133
148
|
"type_name": self.type_name,
|
149
|
+
"sku": self.sku,
|
134
150
|
"name_api": self.name_api,
|
135
151
|
"mac": self.mac,
|
136
152
|
"firmware": self.firmware,
|
blueair_api/util_bootstrap.py
CHANGED
@@ -32,7 +32,6 @@ async def get_devices(
|
|
32
32
|
uuid=device["uuid"],
|
33
33
|
name=device["name"],
|
34
34
|
mac=device["mac"],
|
35
|
-
type_name=device["type"],
|
36
35
|
)
|
37
36
|
|
38
37
|
devices = map(create_device, api_devices)
|
@@ -62,7 +61,10 @@ async def get_aws_devices(
|
|
62
61
|
uuid=device["uuid"],
|
63
62
|
name_api=device["name"],
|
64
63
|
mac=device["mac"],
|
64
|
+
type_name=device["type"],
|
65
65
|
)
|
66
66
|
|
67
|
-
|
68
|
-
|
67
|
+
|
68
|
+
devices = list(map(create_device, api_devices))
|
69
|
+
|
70
|
+
return (api, devices)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
blueair_api/__init__.py,sha256=gk2CZWEnEo4FlP7VcJsDs1kujZ_ryXF5H9n3Kd-4WWo,313
|
2
|
+
blueair_api/callbacks.py,sha256=6hzAAbdq-FQYTgc5RVBQCiqJz3PaBHkIgAkg0P2NZ8U,725
|
3
|
+
blueair_api/const.py,sha256=fRth29dQT1dguM7L4ij8pDefB_vBrevAHqTdfNvSugs,1048
|
4
|
+
blueair_api/device.py,sha256=ekx-smhX6n-evnrh87y1FTSMwSoPa-lQKJNyvTutnSA,3188
|
5
|
+
blueair_api/device_aws.py,sha256=JxVStSXvNC2x3KR6s8nCP78mOWZ0tgyWcZRbKkLQKi8,6657
|
6
|
+
blueair_api/errors.py,sha256=lJ_iFU_W6zQfGRi_wsMhWDw-fAVPFeCkCbT1erIlYQQ,233
|
7
|
+
blueair_api/http_aws_blueair.py,sha256=m_qoCFOYICCu_U_maBvkmOha3YmNtxxtPYyapVBGKNc,17821
|
8
|
+
blueair_api/http_blueair.py,sha256=ieDvjs0_DHSJzseO_qdvLIxdrUUHuTgSHjWb6u-_gRs,7350
|
9
|
+
blueair_api/model_enum.py,sha256=rTZgB3HWI3N7BkyZHKez80wu4WD04D1myYMjGFGvyPA,167
|
10
|
+
blueair_api/stub.py,sha256=04RBMbv3ZdfJzmZISj3grf43AYU7ia0parL0UKDfeXI,1273
|
11
|
+
blueair_api/util.py,sha256=3L9-vfHfN1vUBYU0BA9ruYyNPUTmS21D-uI-Jyo5x6U,1672
|
12
|
+
blueair_api/util_bootstrap.py,sha256=1IQXZ0_nbRiLYnrnmyQcDMdZ7vi4i_CV78vFRxXCPWY,1602
|
13
|
+
blueair_api/util_http.py,sha256=45AJG3Vb6LMVzI0WV22AoSyt64f_Jj3KpOAwF5M6EFE,1327
|
14
|
+
blueair_api-1.12.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
|
15
|
+
blueair_api-1.12.0.dist-info/METADATA,sha256=xQRJFjYD8Z9Y_ZNBWUN15Rn8ViMz-otW8a-92eJ2X0k,1997
|
16
|
+
blueair_api-1.12.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
blueair_api-1.12.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
|
18
|
+
blueair_api-1.12.0.dist-info/RECORD,,
|
@@ -1,17 +0,0 @@
|
|
1
|
-
blueair_api/__init__.py,sha256=TSAR2ntyFQWyGdKNR1iEsJJmQbNMOvnw-xdVONMHdA8,279
|
2
|
-
blueair_api/callbacks.py,sha256=6hzAAbdq-FQYTgc5RVBQCiqJz3PaBHkIgAkg0P2NZ8U,725
|
3
|
-
blueair_api/const.py,sha256=RJtIjEyi4VaAtlnjjBaEdndAtDNUjsm-c78o83CIjgk,1048
|
4
|
-
blueair_api/device.py,sha256=8fzC97FeyCvjML-73ls-vQPs2_aTNX9o-Ywk7ZTVoNI,3193
|
5
|
-
blueair_api/device_aws.py,sha256=0fPs4o335YgQiJ-0lMNQp400LnlSMepbASRliEw3hgk,6104
|
6
|
-
blueair_api/errors.py,sha256=lJ_iFU_W6zQfGRi_wsMhWDw-fAVPFeCkCbT1erIlYQQ,233
|
7
|
-
blueair_api/http_aws_blueair.py,sha256=m_qoCFOYICCu_U_maBvkmOha3YmNtxxtPYyapVBGKNc,17821
|
8
|
-
blueair_api/http_blueair.py,sha256=ieDvjs0_DHSJzseO_qdvLIxdrUUHuTgSHjWb6u-_gRs,7350
|
9
|
-
blueair_api/stub.py,sha256=04RBMbv3ZdfJzmZISj3grf43AYU7ia0parL0UKDfeXI,1273
|
10
|
-
blueair_api/util.py,sha256=3L9-vfHfN1vUBYU0BA9ruYyNPUTmS21D-uI-Jyo5x6U,1672
|
11
|
-
blueair_api/util_bootstrap.py,sha256=OMv4ouaiEClM6A0PVAEIGCoe7ySkHbs8F8rFUpoe6-Y,1600
|
12
|
-
blueair_api/util_http.py,sha256=45AJG3Vb6LMVzI0WV22AoSyt64f_Jj3KpOAwF5M6EFE,1327
|
13
|
-
blueair_api-1.10.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
|
14
|
-
blueair_api-1.10.0.dist-info/METADATA,sha256=6oEm6hMOG8C2HUp9qSC9PaAypxfbOOrmOAUIGf2rTaw,1997
|
15
|
-
blueair_api-1.10.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
16
|
-
blueair_api-1.10.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
|
17
|
-
blueair_api-1.10.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|