blueair-api 1.17.0__py3-none-any.whl → 1.18.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/device.py +22 -11
- blueair_api/util_bootstrap.py +9 -10
- {blueair_api-1.17.0.dist-info → blueair_api-1.18.0.dist-info}/METADATA +1 -1
- {blueair_api-1.17.0.dist-info → blueair_api-1.18.0.dist-info}/RECORD +7 -7
- {blueair_api-1.17.0.dist-info → blueair_api-1.18.0.dist-info}/LICENSE +0 -0
- {blueair_api-1.17.0.dist-info → blueair_api-1.18.0.dist-info}/WHEEL +0 -0
- {blueair_api-1.17.0.dist-info → blueair_api-1.18.0.dist-info}/top_level.txt +0 -0
blueair_api/device.py
CHANGED
@@ -9,6 +9,28 @@ _LOGGER = logging.getLogger(__name__)
|
|
9
9
|
|
10
10
|
@dataclasses.dataclass(slots=True)
|
11
11
|
class Device(CallbacksMixin):
|
12
|
+
@classmethod
|
13
|
+
async def create_device(cls, api, uuid, name, mac, refresh=False):
|
14
|
+
_LOGGER.debug("UUID:"+uuid)
|
15
|
+
info = await api.get_info(uuid)
|
16
|
+
device = Device(
|
17
|
+
api=api,
|
18
|
+
uuid=uuid,
|
19
|
+
name=name,
|
20
|
+
mac=mac,
|
21
|
+
timezone=info["timezone"],
|
22
|
+
compatibility=info["compatibility"],
|
23
|
+
model=info["model"],
|
24
|
+
firmware=info["firmware"],
|
25
|
+
mcu_firmware=info["mcuFirmware"],
|
26
|
+
wlan_driver=info["wlanDriver"],
|
27
|
+
room_location=info["roomLocation"]
|
28
|
+
)
|
29
|
+
if refresh:
|
30
|
+
await device.refresh()
|
31
|
+
_LOGGER.debug(f"create_device blueair device: {device}")
|
32
|
+
return device
|
33
|
+
|
12
34
|
api: HttpBlueair
|
13
35
|
uuid: str | None = None
|
14
36
|
name: str | None = None
|
@@ -29,17 +51,6 @@ class Device(CallbacksMixin):
|
|
29
51
|
filter_expired: bool | None = None
|
30
52
|
wifi_working: bool | None = None
|
31
53
|
|
32
|
-
async def post_init(self):
|
33
|
-
info = await self.api.get_info(self.uuid)
|
34
|
-
self.timezone = info["timezone"]
|
35
|
-
self.compatibility = info["compatibility"]
|
36
|
-
self.model = info["model"]
|
37
|
-
self.firmware = info["firmware"]
|
38
|
-
self.mcu_firmware = info["mcuFirmware"]
|
39
|
-
self.wlan_driver = info["wlanDriver"]
|
40
|
-
self.room_location = info["roomLocation"]
|
41
|
-
_LOGGER.debug(f"post_init blueair device: {self}")
|
42
|
-
|
43
54
|
async def refresh(self):
|
44
55
|
_LOGGER.debug("Requesting current attributes...")
|
45
56
|
attributes = await self.api.get_attributes(self.uuid)
|
blueair_api/util_bootstrap.py
CHANGED
@@ -26,18 +26,17 @@ async def get_devices(
|
|
26
26
|
)
|
27
27
|
api_devices = await api.get_devices()
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
devices = map(create_device, api_devices)
|
29
|
+
devices = list()
|
30
|
+
for api_device in api_devices:
|
31
|
+
devices.append(await Device.create_device(
|
32
|
+
api,
|
33
|
+
api_device["uuid"],
|
34
|
+
api_device["name"],
|
35
|
+
api_device["mac"]
|
36
|
+
))
|
38
37
|
return (
|
39
38
|
api,
|
40
|
-
|
39
|
+
devices,
|
41
40
|
)
|
42
41
|
|
43
42
|
|
@@ -1,7 +1,7 @@
|
|
1
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=
|
4
|
+
blueair_api/device.py,sha256=CugWoAbtSPd-rQMkg4MEYEWdx77tCExOqJ5_xzkfDvM,2636
|
5
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
|
@@ -9,10 +9,10 @@ blueair_api/http_blueair.py,sha256=ieDvjs0_DHSJzseO_qdvLIxdrUUHuTgSHjWb6u-_gRs,7
|
|
9
9
|
blueair_api/model_enum.py,sha256=Em-Lu_1B_Jh5ut8GuDH9NGPQb_OykxsRFW0y0P5x3gk,2085
|
10
10
|
blueair_api/stub.py,sha256=yJLfmrHjAH0XKl9HVTkKt-Ks9bG6Uhlkn3H2Jf3REJQ,1278
|
11
11
|
blueair_api/util.py,sha256=3L9-vfHfN1vUBYU0BA9ruYyNPUTmS21D-uI-Jyo5x6U,1672
|
12
|
-
blueair_api/util_bootstrap.py,sha256=
|
12
|
+
blueair_api/util_bootstrap.py,sha256=1WvEdb6UfhFHkCwnLr7TZZ_HuPUx3klW6fUPtnP2SI0,1596
|
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.18.0.dist-info/LICENSE,sha256=W6UV41yCe1R_Avet8VtsxwdJar18n40b3MRnbEMHZmI,1066
|
15
|
+
blueair_api-1.18.0.dist-info/METADATA,sha256=MNd7vmSf96doSh7UveskrcoZmmWWMjsZ8h86s7BvWjc,1995
|
16
|
+
blueair_api-1.18.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
blueair_api-1.18.0.dist-info/top_level.txt,sha256=-gn0jNtmE83qEu70uMW5F4JrXnHGRfuFup1EPWF70oc,12
|
18
|
+
blueair_api-1.18.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|