Skip to content

Commit 616ec15

Browse files
committed
feat: add enum of known and tested models to aws devices
1 parent ff284a2 commit 616ec15

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

src/blueair_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
from .util_bootstrap import get_devices, get_aws_devices
55
from .device import Device
66
from .device_aws import DeviceAws
7+
from .model_enum import ModelEnum

src/blueair_api/const.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from collections.abc import Mapping
22
from typing_extensions import TypedDict
33

4-
54
SENSITIVE_FIELD_NAMES = [
65
"username",
76
"password",
@@ -10,13 +9,6 @@
109
# The BlueAir API uses a fixed API key.
1110
API_KEY = "eyJhbGciOiJIUzI1NiJ9.eyJncmFudGVlIjoiYmx1ZWFpciIsImlhdCI6MTQ1MzEyNTYzMiwidmFsaWRpdHkiOi0xLCJqdGkiOiJkNmY3OGE0Yi1iMWNkLTRkZDgtOTA2Yi1kN2JkNzM0MTQ2NzQiLCJwZXJtaXNzaW9ucyI6WyJhbGwiXSwicXVvdGEiOi0xLCJyYXRlTGltaXQiOi0xfQ.CJsfWVzFKKDDA6rWdh-hjVVVE9S3d6Hu9BzXG9htWFw" # noqa: E501
1211

13-
14-
class MeasurementBundle(TypedDict):
15-
sensors: list[str]
16-
datapoints: list[list[int | float]]
17-
18-
MeasurementList = list[Mapping[str, int | float]]
19-
2012
AWS_APIKEYS = {
2113
"us": {
2214
"gigyaRegion": "us1",
@@ -31,3 +23,11 @@ class MeasurementBundle(TypedDict):
3123
"apiKey": "3_qRseYzrUJl1VyxvSJANalu_kNgQ83swB1B9uzgms58--5w1ClVNmrFdsDnWVQQCl",
3224
},
3325
}
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]]

src/blueair_api/device_aws.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from .callbacks import CallbacksMixin
44
from .http_aws_blueair import HttpAwsBlueair
5+
from .model_enum import ModelEnum
56
from .util import convert_api_array_to_dict, safely_get_json_value
67

78
_LOGGER = logging.getLogger(__name__)
@@ -132,6 +133,14 @@ async def set_wick_dry_mode(self, value: bool):
132133
await self.api.set_device_info(self.uuid, "wickdrys", "vb", value)
133134
self.publish_updates()
134135

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+
135144
def __repr__(self):
136145
return {
137146
"uuid": self.uuid,

src/blueair_api/model_enum.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import StrEnum
2+
3+
4+
class ModelEnum(StrEnum):
5+
UNKNOWN = "Unknown"
6+
HUMIDIFIER_I35 = "Blueair Humidifier i35"
7+
PROTECT_7470I = "Blueair Protect 7470i"

0 commit comments

Comments
 (0)