blueair-api 1.15.1__py3-none-any.whl → 1.16.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 -1
- blueair_api/device.py +3 -15
- blueair_api/device_aws.py +3 -17
- blueair_api/model_enum.py +70 -7
- blueair_api/stub.py +1 -1
- {blueair_api-1.15.1.dist-info → blueair_api-1.16.0.dist-info}/METADATA +1 -1
- {blueair_api-1.15.1.dist-info → blueair_api-1.16.0.dist-info}/RECORD +10 -10
- {blueair_api-1.15.1.dist-info → blueair_api-1.16.0.dist-info}/LICENSE +0 -0
- {blueair_api-1.15.1.dist-info → blueair_api-1.16.0.dist-info}/WHEEL +0 -0
- {blueair_api-1.15.1.dist-info → blueair_api-1.16.0.dist-info}/top_level.txt +0 -0
blueair_api/__init__.py
CHANGED
blueair_api/device.py
CHANGED
@@ -7,7 +7,7 @@ from .http_blueair import HttpBlueair
|
|
7
7
|
_LOGGER = logging.getLogger(__name__)
|
8
8
|
|
9
9
|
|
10
|
-
@dataclasses.dataclass(
|
10
|
+
@dataclasses.dataclass(slots=True)
|
11
11
|
class Device(CallbacksMixin):
|
12
12
|
api: HttpBlueair
|
13
13
|
uuid: str | None = None
|
@@ -29,19 +29,7 @@ class Device(CallbacksMixin):
|
|
29
29
|
filter_expired: bool | None = None
|
30
30
|
wifi_working: bool | None = None
|
31
31
|
|
32
|
-
def
|
33
|
-
self,
|
34
|
-
api: HttpBlueair,
|
35
|
-
uuid: str = None,
|
36
|
-
name: str = None,
|
37
|
-
mac: str = None,
|
38
|
-
):
|
39
|
-
self.api = api
|
40
|
-
self.uuid = uuid
|
41
|
-
self.name = name
|
42
|
-
self.mac = mac
|
43
|
-
|
44
|
-
async def init(self):
|
32
|
+
async def post_init(self):
|
45
33
|
info = await self.api.get_info(self.uuid)
|
46
34
|
self.timezone = info["timezone"]
|
47
35
|
self.compatibility = info["compatibility"]
|
@@ -50,7 +38,7 @@ class Device(CallbacksMixin):
|
|
50
38
|
self.mcu_firmware = info["mcuFirmware"]
|
51
39
|
self.wlan_driver = info["wlanDriver"]
|
52
40
|
self.room_location = info["roomLocation"]
|
53
|
-
_LOGGER.debug(f"
|
41
|
+
_LOGGER.debug(f"post_init blueair device: {self}")
|
54
42
|
|
55
43
|
async def refresh(self):
|
56
44
|
_LOGGER.debug("Requesting current attributes...")
|
blueair_api/device_aws.py
CHANGED
@@ -8,7 +8,8 @@ from .util import convert_api_array_to_dict, safely_get_json_value
|
|
8
8
|
|
9
9
|
_LOGGER = logging.getLogger(__name__)
|
10
10
|
|
11
|
-
|
11
|
+
|
12
|
+
@dataclasses.dataclass(slots=True)
|
12
13
|
class DeviceAws(CallbacksMixin):
|
13
14
|
api: HttpAwsBlueair
|
14
15
|
uuid: str = None
|
@@ -45,23 +46,8 @@ class DeviceAws(CallbacksMixin):
|
|
45
46
|
water_shortage: bool = None
|
46
47
|
auto_regulated_humidity: int = None
|
47
48
|
|
48
|
-
def __init__(
|
49
|
-
self,
|
50
|
-
api: HttpAwsBlueair,
|
51
|
-
uuid: str = None,
|
52
|
-
name_api: str = None,
|
53
|
-
mac: str = None,
|
54
|
-
type_name: str = None,
|
55
|
-
):
|
56
|
-
self.api = api
|
57
|
-
self.uuid = uuid
|
58
|
-
self.name_api = name_api
|
59
|
-
self.mac = mac
|
60
|
-
self.type_name = type_name
|
61
|
-
_LOGGER.debug(f"creating blueair device aws: {self.uuid}")
|
62
|
-
|
63
49
|
async def refresh(self):
|
64
|
-
_LOGGER.debug(f"refreshing blueair device aws: {self
|
50
|
+
_LOGGER.debug(f"refreshing blueair device aws: {self}")
|
65
51
|
info = await self.api.device_info(self.name_api, self.uuid)
|
66
52
|
sensor_data = convert_api_array_to_dict(info["sensordata"])
|
67
53
|
self.pm1 = safely_get_json_value(sensor_data, "pm1", int)
|
blueair_api/model_enum.py
CHANGED
@@ -1,9 +1,72 @@
|
|
1
|
-
from enum import StrEnum
|
1
|
+
from enum import Enum, StrEnum
|
2
2
|
|
3
3
|
|
4
|
-
class
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
class FeatureEnum(StrEnum):
|
5
|
+
TEMPERATURE = "Temperature"
|
6
|
+
HUMIDITY = "Humidity"
|
7
|
+
VOC = "VOC"
|
8
|
+
PM1 = "PM1"
|
9
|
+
PM10 = "PM10"
|
10
|
+
PM25 = "PM25"
|
11
|
+
WATER_SHORTAGE = "Water Shortage"
|
12
|
+
FILTER_EXPIRED = "Filter Expired"
|
13
|
+
|
14
|
+
|
15
|
+
class ModelEnum(Enum):
|
16
|
+
def __new__(cls, *args, **kwds):
|
17
|
+
value = len(cls.__members__) + 1
|
18
|
+
obj = object.__new__(cls)
|
19
|
+
obj._value_ = value
|
20
|
+
return obj
|
21
|
+
|
22
|
+
def __init__(self,
|
23
|
+
name,
|
24
|
+
supported_features):
|
25
|
+
self.model_name = name
|
26
|
+
self.supported_features = supported_features
|
27
|
+
|
28
|
+
def supports_feature(self, supported_features) -> bool:
|
29
|
+
return supported_features in self.supported_features
|
30
|
+
|
31
|
+
UNKNOWN = "Unknown", [
|
32
|
+
FeatureEnum.TEMPERATURE,
|
33
|
+
FeatureEnum.HUMIDITY,
|
34
|
+
FeatureEnum.WATER_SHORTAGE,
|
35
|
+
FeatureEnum.VOC,
|
36
|
+
FeatureEnum.PM1,
|
37
|
+
FeatureEnum.PM10,
|
38
|
+
FeatureEnum.PM25,
|
39
|
+
FeatureEnum.FILTER_EXPIRED,
|
40
|
+
]
|
41
|
+
HUMIDIFIER_H35I = "Blueair Humidifier H35i", [
|
42
|
+
FeatureEnum.TEMPERATURE,
|
43
|
+
FeatureEnum.HUMIDITY,
|
44
|
+
FeatureEnum.WATER_SHORTAGE,
|
45
|
+
]
|
46
|
+
PROTECT_7470I = "Blueair Protect 7470i", [
|
47
|
+
FeatureEnum.TEMPERATURE,
|
48
|
+
FeatureEnum.HUMIDITY,
|
49
|
+
FeatureEnum.VOC,
|
50
|
+
FeatureEnum.PM1,
|
51
|
+
FeatureEnum.PM10,
|
52
|
+
FeatureEnum.PM25,
|
53
|
+
FeatureEnum.FILTER_EXPIRED
|
54
|
+
]
|
55
|
+
MAX_211I = "Blueair Blue Pure 211i Max", [
|
56
|
+
FeatureEnum.TEMPERATURE,
|
57
|
+
FeatureEnum.HUMIDITY,
|
58
|
+
FeatureEnum.VOC,
|
59
|
+
FeatureEnum.PM1,
|
60
|
+
FeatureEnum.PM10,
|
61
|
+
FeatureEnum.PM25,
|
62
|
+
FeatureEnum.FILTER_EXPIRED
|
63
|
+
]
|
64
|
+
MAX_311I = "Blueair Blue Pure 311i Max", [
|
65
|
+
FeatureEnum.TEMPERATURE,
|
66
|
+
FeatureEnum.HUMIDITY,
|
67
|
+
FeatureEnum.VOC,
|
68
|
+
FeatureEnum.PM1,
|
69
|
+
FeatureEnum.PM10,
|
70
|
+
FeatureEnum.PM25,
|
71
|
+
FeatureEnum.FILTER_EXPIRED
|
72
|
+
]
|
blueair_api/stub.py
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
blueair_api/__init__.py,sha256=
|
1
|
+
blueair_api/__init__.py,sha256=GucsIENhTF4AVxPn4Xyr4imUxJJ8RO8RYt1opHCF2hQ,326
|
2
2
|
blueair_api/callbacks.py,sha256=eqgfe1qN_NNWOp2qNSP123zQJxh_Ie6vZXp5EHp6ePc,757
|
3
3
|
blueair_api/const.py,sha256=fRth29dQT1dguM7L4ij8pDefB_vBrevAHqTdfNvSugs,1048
|
4
|
-
blueair_api/device.py,sha256=
|
5
|
-
blueair_api/device_aws.py,sha256=
|
4
|
+
blueair_api/device.py,sha256=ogpUE0nH7s4o3rXHkioixm8S_jC79pYya0opLkTbc0c,2362
|
5
|
+
blueair_api/device_aws.py,sha256=8UYMInVnBI4nvfKO3ldtI18u99soCM-0FG3Vec8R89c,5272
|
6
6
|
blueair_api/errors.py,sha256=lJ_iFU_W6zQfGRi_wsMhWDw-fAVPFeCkCbT1erIlYQQ,233
|
7
7
|
blueair_api/http_aws_blueair.py,sha256=m_qoCFOYICCu_U_maBvkmOha3YmNtxxtPYyapVBGKNc,17821
|
8
8
|
blueair_api/http_blueair.py,sha256=ieDvjs0_DHSJzseO_qdvLIxdrUUHuTgSHjWb6u-_gRs,7350
|
9
|
-
blueair_api/model_enum.py,sha256=
|
10
|
-
blueair_api/stub.py,sha256=
|
9
|
+
blueair_api/model_enum.py,sha256=mNhdtt6XwSAe6ux9FtWVZ8DM1k7O1jcTjM1fYylRLUY,1924
|
10
|
+
blueair_api/stub.py,sha256=yJLfmrHjAH0XKl9HVTkKt-Ks9bG6Uhlkn3H2Jf3REJQ,1278
|
11
11
|
blueair_api/util.py,sha256=3L9-vfHfN1vUBYU0BA9ruYyNPUTmS21D-uI-Jyo5x6U,1672
|
12
12
|
blueair_api/util_bootstrap.py,sha256=1IQXZ0_nbRiLYnrnmyQcDMdZ7vi4i_CV78vFRxXCPWY,1602
|
13
13
|
blueair_api/util_http.py,sha256=45AJG3Vb6LMVzI0WV22AoSyt64f_Jj3KpOAwF5M6EFE,1327
|
14
|
-
blueair_api-1.
|
15
|
-
blueair_api-1.
|
16
|
-
blueair_api-1.
|
17
|
-
blueair_api-1.
|
18
|
-
blueair_api-1.
|
14
|
+
blueair_api-1.16.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
|
15
|
+
blueair_api-1.16.0.dist-info/METADATA,sha256=pfD_isWd7rxEOXzhVvbhoR-AmdEpk9YwcRiWOkvZt14,1995
|
16
|
+
blueair_api-1.16.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
blueair_api-1.16.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
|
18
|
+
blueair_api-1.16.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|