blueair-api 1.11.0__py3-none-any.whl → 1.12.1__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 CHANGED
@@ -4,3 +4,4 @@ from .http_aws_blueair import HttpAwsBlueair
4
4
  from .util_bootstrap import get_devices, get_aws_devices
5
5
  from .device import Device
6
6
  from .device_aws import DeviceAws
7
+ from .model_enum import ModelEnum
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.name}")
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)
@@ -62,15 +62,13 @@ class Device(CallbacksMixin):
62
62
  if "night_mode" in attributes:
63
63
  self.night_mode = bool(attributes["night_mode"])
64
64
  self.fan_speed = int(attributes["fan_speed"])
65
- if "filter_status":
65
+ if "filter_status" in attributes:
66
66
  self.filter_expired = attributes["filter_status"] != "OK"
67
- else:
68
- self.filter_expired = None
69
67
  self.fan_mode = attributes["mode"]
70
68
  if "wifi_status" in attributes:
71
69
  self.wifi_working = attributes["wifi_status"] == "1"
72
70
  else:
73
- self.wifi_working = 0
71
+ self.wifi_working = False
74
72
  self.publish_updates()
75
73
 
76
74
  async def set_fan_speed(self, new_speed):
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__)
@@ -132,6 +133,14 @@ class DeviceAws(CallbacksMixin):
132
133
  await self.api.set_device_info(self.uuid, "wickdrys", "vb", value)
133
134
  self.publish_updates()
134
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
+
135
144
  def __repr__(self):
136
145
  return {
137
146
  "uuid": self.uuid,
@@ -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"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blueair_api
3
- Version: 1.11.0
3
+ Version: 1.12.1
4
4
  Summary: Blueair Api Wrapper
5
5
  Author-email: Brendan Dahl <dahl.brendan@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/dahlb/blueair_api
@@ -1,17 +1,18 @@
1
- blueair_api/__init__.py,sha256=TSAR2ntyFQWyGdKNR1iEsJJmQbNMOvnw-xdVONMHdA8,279
1
+ blueair_api/__init__.py,sha256=gk2CZWEnEo4FlP7VcJsDs1kujZ_ryXF5H9n3Kd-4WWo,313
2
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=MiBv-5TGrJCMfsuVnnndgP0SMSWz8wFo9i8RYyg-TEo,6388
3
+ blueair_api/const.py,sha256=fRth29dQT1dguM7L4ij8pDefB_vBrevAHqTdfNvSugs,1048
4
+ blueair_api/device.py,sha256=o6rUnoTQdQOKni0eoIDebM2FLpRFMbW22-uVSRk3kGs,3153
5
+ blueair_api/device_aws.py,sha256=JxVStSXvNC2x3KR6s8nCP78mOWZ0tgyWcZRbKkLQKi8,6657
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=rTZgB3HWI3N7BkyZHKez80wu4WD04D1myYMjGFGvyPA,167
9
10
  blueair_api/stub.py,sha256=04RBMbv3ZdfJzmZISj3grf43AYU7ia0parL0UKDfeXI,1273
10
11
  blueair_api/util.py,sha256=3L9-vfHfN1vUBYU0BA9ruYyNPUTmS21D-uI-Jyo5x6U,1672
11
12
  blueair_api/util_bootstrap.py,sha256=1IQXZ0_nbRiLYnrnmyQcDMdZ7vi4i_CV78vFRxXCPWY,1602
12
13
  blueair_api/util_http.py,sha256=45AJG3Vb6LMVzI0WV22AoSyt64f_Jj3KpOAwF5M6EFE,1327
13
- blueair_api-1.11.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
14
- blueair_api-1.11.0.dist-info/METADATA,sha256=CEltWqFqbIUK8_RPCzc_V0wh4vmcmqSo30fuwJF3P6c,1997
15
- blueair_api-1.11.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
16
- blueair_api-1.11.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
17
- blueair_api-1.11.0.dist-info/RECORD,,
14
+ blueair_api-1.12.1.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
15
+ blueair_api-1.12.1.dist-info/METADATA,sha256=n4YQGoreNASI1IfwG5nKY4roMsOcemfnYAIMqS3XYlk,1997
16
+ blueair_api-1.12.1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
17
+ blueair_api-1.12.1.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
18
+ blueair_api-1.12.1.dist-info/RECORD,,