blueair-api 1.31.3__tar.gz → 1.32.0__tar.gz
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-1.31.3 → blueair_api-1.32.0}/PKG-INFO +1 -1
- {blueair_api-1.31.3 → blueair_api-1.32.0}/pyproject.toml +1 -1
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/device_aws.py +59 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api.egg-info/PKG-INFO +1 -1
- {blueair_api-1.31.3 → blueair_api-1.32.0}/tests/test_device_aws.py +145 -10
- {blueair_api-1.31.3 → blueair_api-1.32.0}/LICENSE +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/README.md +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/setup.cfg +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/__init__.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/callbacks.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/const.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/device.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/errors.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/http_aws_blueair.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/http_blueair.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/intermediate_representation_aws.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/model_enum.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/stub.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/util.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/util_bootstrap.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/util_http.py +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api.egg-info/SOURCES.txt +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api.egg-info/dependency_links.txt +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api.egg-info/requires.txt +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api.egg-info/top_level.txt +0 -0
- {blueair_api-1.31.3 → blueair_api-1.32.0}/tests/test_intermediate_representation_aws.py +0 -0
@@ -66,6 +66,15 @@ class DeviceAws(CallbacksMixin):
|
|
66
66
|
water_shortage : AttributeType[bool] = None
|
67
67
|
auto_regulated_humidity : AttributeType[int] = None
|
68
68
|
|
69
|
+
main_mode: AttributeType[int] = None # api value 0 purify only, 1 heat on, 2 cool on
|
70
|
+
heat_sub_mode: AttributeType[int] = None # api value 1 heat on, 2 heat on with fan auto
|
71
|
+
heat_fan_speed: AttributeType[int] = None # api value 11/37/64/91
|
72
|
+
heat_temp: AttributeType[int] = None # api value is celsius * 10
|
73
|
+
cool_sub_mode: AttributeType[int] = None # api value 1 cool on, 2 cool on with fan auto
|
74
|
+
cool_fan_speed: AttributeType[int] = None # api value 11/37/64/91
|
75
|
+
ap_sub_mode: AttributeType[int] = None # api value 1 manual speeed, 2 auto fan speed
|
76
|
+
fan_speed_0: AttributeType[int] = None # api value 11/37/64/91
|
77
|
+
|
69
78
|
async def refresh(self):
|
70
79
|
_LOGGER.debug(f"refreshing blueair device aws: {self}")
|
71
80
|
self.raw_info = await self.api.device_info(self.name_api, self.uuid)
|
@@ -117,11 +126,21 @@ class DeviceAws(CallbacksMixin):
|
|
117
126
|
self.fan_speed = states_safe_get("fanspeed")
|
118
127
|
self.fan_auto_mode = states_safe_get("automode")
|
119
128
|
self.filter_usage_percentage = states_safe_get("filterusage")
|
129
|
+
|
120
130
|
self.wick_usage_percentage = states_safe_get("wickusage")
|
121
131
|
self.wick_dry_mode = states_safe_get("wickdrys")
|
122
132
|
self.auto_regulated_humidity = states_safe_get("autorh")
|
123
133
|
self.water_shortage = states_safe_get("wshortage")
|
124
134
|
|
135
|
+
self.main_mode = states_safe_get("mainmode")
|
136
|
+
self.heat_temp = states_safe_get("heattemp")
|
137
|
+
self.heat_sub_mode = states_safe_get("heatsubmode")
|
138
|
+
self.heat_fan_speed = states_safe_get("heatfs")
|
139
|
+
self.cool_sub_mode = states_safe_get("coolsubmode")
|
140
|
+
self.cool_fan_speed = states_safe_get("coolfs")
|
141
|
+
self.ap_sub_mode = states_safe_get("apsubmode")
|
142
|
+
self.fan_speed_0 = states_safe_get("fsp0")
|
143
|
+
|
125
144
|
self.publish_updates()
|
126
145
|
_LOGGER.debug(f"refreshed blueair device aws: {self}")
|
127
146
|
|
@@ -170,6 +189,46 @@ class DeviceAws(CallbacksMixin):
|
|
170
189
|
await self.api.set_device_info(self.uuid, "germshield", "vb", value)
|
171
190
|
self.publish_updates()
|
172
191
|
|
192
|
+
async def set_main_mode(self, value: int):
|
193
|
+
self.main_mode = value
|
194
|
+
await self.api.set_device_info(self.uuid, "mainmode", "v", value)
|
195
|
+
self.publish_updates()
|
196
|
+
|
197
|
+
async def set_heat_temp(self, value: int):
|
198
|
+
self.heat_temp = value
|
199
|
+
await self.api.set_device_info(self.uuid, "heattemp", "v", value)
|
200
|
+
self.publish_updates()
|
201
|
+
|
202
|
+
async def set_heat_sub_mode(self, value: int):
|
203
|
+
self.heat_sub_mode = value
|
204
|
+
await self.api.set_device_info(self.uuid, "heatsubmode", "v", value)
|
205
|
+
self.publish_updates()
|
206
|
+
|
207
|
+
async def set_heat_fan_speed(self, value: int):
|
208
|
+
self.heat_fan_speed = value
|
209
|
+
await self.api.set_device_info(self.uuid, "heatfs", "v", value)
|
210
|
+
self.publish_updates()
|
211
|
+
|
212
|
+
async def set_cool_sub_mode(self, value: int):
|
213
|
+
self.cool_sub_mode = value
|
214
|
+
await self.api.set_device_info(self.uuid, "coolsubmode", "v", value)
|
215
|
+
self.publish_updates()
|
216
|
+
|
217
|
+
async def set_cool_fan_speed(self, value: int):
|
218
|
+
self.cool_fan_speed = value
|
219
|
+
await self.api.set_device_info(self.uuid, "coolfs", "v", value)
|
220
|
+
self.publish_updates()
|
221
|
+
|
222
|
+
async def set_ap_sub_mode(self, value: int):
|
223
|
+
self.ap_sub_mode = value
|
224
|
+
await self.api.set_device_info(self.uuid, "apsubmode", "v", value)
|
225
|
+
self.publish_updates()
|
226
|
+
|
227
|
+
async def set_fan_speed_0(self, value: int):
|
228
|
+
self.fan_speed_0 = value
|
229
|
+
await self.api.set_device_info(self.uuid, "fsp0", "v", value)
|
230
|
+
self.publish_updates()
|
231
|
+
|
173
232
|
@property
|
174
233
|
def model(self) -> ModelEnum:
|
175
234
|
if self.sku == "111633":
|
@@ -109,15 +109,23 @@ class DeviceAwsSetterTest(DeviceAwsTestBase):
|
|
109
109
|
# minimally populate dc to define the states.
|
110
110
|
fake = {"n": "n", "v": 0}
|
111
111
|
ir.query_json(self.device_info_helper.info, "configuration.dc").update({
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
"brightness": fake,
|
113
|
+
"fanspeed": fake,
|
114
|
+
"standby": fake,
|
115
|
+
"germshield": fake,
|
116
|
+
"automode": fake,
|
117
|
+
"autorh": fake,
|
118
|
+
"childlock": fake,
|
119
|
+
"nightmode": fake,
|
120
|
+
"wickdrys": fake,
|
121
|
+
"mainmode": fake,
|
122
|
+
"heattemp": fake,
|
123
|
+
"heatsubmode": fake,
|
124
|
+
"heatfs": fake,
|
125
|
+
"coolsubmode": fake,
|
126
|
+
"coolfs": fake,
|
127
|
+
"apsubmode": fake,
|
128
|
+
"fsp0": fake,
|
121
129
|
})
|
122
130
|
|
123
131
|
async def test_brightness(self):
|
@@ -228,6 +236,102 @@ class DeviceAwsSetterTest(DeviceAwsTestBase):
|
|
228
236
|
await self.device.refresh()
|
229
237
|
assert self.device.wick_dry_mode is True
|
230
238
|
|
239
|
+
async def test_main_mode(self):
|
240
|
+
# test cache works
|
241
|
+
self.device.main_mode = None
|
242
|
+
await self.device.set_main_mode(1)
|
243
|
+
assert self.device.main_mode == 1
|
244
|
+
|
245
|
+
# test refresh works
|
246
|
+
await self.device.set_main_mode(2)
|
247
|
+
self.device.main_mode = None
|
248
|
+
await self.device.refresh()
|
249
|
+
assert self.device.main_mode == 2
|
250
|
+
|
251
|
+
async def test_heat_temp(self):
|
252
|
+
# test cache works
|
253
|
+
self.device.heat_temp = None
|
254
|
+
await self.device.set_heat_temp(1)
|
255
|
+
assert self.device.heat_temp == 1
|
256
|
+
|
257
|
+
# test refresh works
|
258
|
+
await self.device.set_heat_temp(2)
|
259
|
+
self.device.heat_temp = None
|
260
|
+
await self.device.refresh()
|
261
|
+
assert self.device.heat_temp == 2
|
262
|
+
|
263
|
+
async def test_heat_sub_mode(self):
|
264
|
+
# test cache works
|
265
|
+
self.device.heat_sub_mode = None
|
266
|
+
await self.device.set_heat_sub_mode(1)
|
267
|
+
assert self.device.heat_sub_mode == 1
|
268
|
+
|
269
|
+
# test refresh works
|
270
|
+
await self.device.set_heat_sub_mode(2)
|
271
|
+
self.device.heat_sub_mode = None
|
272
|
+
await self.device.refresh()
|
273
|
+
assert self.device.heat_sub_mode == 2
|
274
|
+
|
275
|
+
async def test_heat_fan_speed(self):
|
276
|
+
# test cache works
|
277
|
+
self.device.heat_fan_speed = None
|
278
|
+
await self.device.set_heat_fan_speed(1)
|
279
|
+
assert self.device.heat_fan_speed == 1
|
280
|
+
|
281
|
+
# test refresh works
|
282
|
+
await self.device.set_heat_fan_speed(2)
|
283
|
+
self.device.heat_fan_speed = None
|
284
|
+
await self.device.refresh()
|
285
|
+
assert self.device.heat_fan_speed == 2
|
286
|
+
|
287
|
+
async def test_cool_sub_mode(self):
|
288
|
+
# test cache works
|
289
|
+
self.device.cool_sub_mode = None
|
290
|
+
await self.device.set_cool_sub_mode(1)
|
291
|
+
assert self.device.cool_sub_mode == 1
|
292
|
+
|
293
|
+
# test refresh works
|
294
|
+
await self.device.set_cool_sub_mode(2)
|
295
|
+
self.device.cool_sub_mode = None
|
296
|
+
await self.device.refresh()
|
297
|
+
assert self.device.cool_sub_mode == 2
|
298
|
+
|
299
|
+
async def test_cool_fan_speed(self):
|
300
|
+
# test cache works
|
301
|
+
self.device.cool_fan_speed = None
|
302
|
+
await self.device.set_cool_fan_speed(1)
|
303
|
+
assert self.device.cool_fan_speed == 1
|
304
|
+
|
305
|
+
# test refresh works
|
306
|
+
await self.device.set_cool_fan_speed(2)
|
307
|
+
self.device.cool_fan_speed = None
|
308
|
+
await self.device.refresh()
|
309
|
+
assert self.device.cool_fan_speed == 2
|
310
|
+
|
311
|
+
async def test_ap_sub_mode(self):
|
312
|
+
# test cache works
|
313
|
+
self.device.ap_sub_mode = None
|
314
|
+
await self.device.set_ap_sub_mode(1)
|
315
|
+
assert self.device.ap_sub_mode == 1
|
316
|
+
|
317
|
+
# test refresh works
|
318
|
+
await self.device.set_ap_sub_mode(2)
|
319
|
+
self.device.ap_sub_mode = None
|
320
|
+
await self.device.refresh()
|
321
|
+
assert self.device.ap_sub_mode == 2
|
322
|
+
|
323
|
+
async def test_fan_speed_0(self):
|
324
|
+
# test cache works
|
325
|
+
self.device.fan_speed_0 = None
|
326
|
+
await self.device.set_fan_speed_0(1)
|
327
|
+
assert self.device.fan_speed_0 == 1
|
328
|
+
|
329
|
+
# test refresh works
|
330
|
+
await self.device.set_fan_speed_0(2)
|
331
|
+
self.device.fan_speed_0 = None
|
332
|
+
await self.device.refresh()
|
333
|
+
assert self.device.fan_speed_0 == 2
|
334
|
+
|
231
335
|
|
232
336
|
class EmptyDeviceAwsTest(DeviceAwsTestBase):
|
233
337
|
"""Tests for a emptydevice.
|
@@ -272,6 +376,14 @@ class EmptyDeviceAwsTest(DeviceAwsTestBase):
|
|
272
376
|
assert device.auto_regulated_humidity is NotImplemented
|
273
377
|
assert device.water_shortage is NotImplemented
|
274
378
|
assert device.wick_dry_mode is NotImplemented
|
379
|
+
assert device.main_mode is NotImplemented
|
380
|
+
assert device.ap_sub_mode is NotImplemented
|
381
|
+
assert device.heat_temp is NotImplemented
|
382
|
+
assert device.heat_sub_mode is NotImplemented
|
383
|
+
assert device.heat_fan_speed is NotImplemented
|
384
|
+
assert device.cool_sub_mode is NotImplemented
|
385
|
+
assert device.cool_fan_speed is NotImplemented
|
386
|
+
assert device.fan_speed_0 is NotImplemented
|
275
387
|
|
276
388
|
|
277
389
|
class H35iTest(DeviceAwsTestBase):
|
@@ -317,7 +429,14 @@ class H35iTest(DeviceAwsTestBase):
|
|
317
429
|
assert device.auto_regulated_humidity == 50
|
318
430
|
assert device.water_shortage is False
|
319
431
|
assert device.wick_dry_mode is False
|
320
|
-
|
432
|
+
assert device.main_mode is NotImplemented
|
433
|
+
assert device.ap_sub_mode is NotImplemented
|
434
|
+
assert device.heat_temp is NotImplemented
|
435
|
+
assert device.heat_sub_mode is NotImplemented
|
436
|
+
assert device.heat_fan_speed is NotImplemented
|
437
|
+
assert device.cool_sub_mode is NotImplemented
|
438
|
+
assert device.cool_fan_speed is NotImplemented
|
439
|
+
assert device.fan_speed_0 is NotImplemented
|
321
440
|
|
322
441
|
class T10iTest(DeviceAwsTestBase):
|
323
442
|
"""Tests for T10i."""
|
@@ -362,6 +481,14 @@ class T10iTest(DeviceAwsTestBase):
|
|
362
481
|
assert device.auto_regulated_humidity is NotImplemented
|
363
482
|
assert device.water_shortage is NotImplemented
|
364
483
|
assert device.wick_dry_mode is NotImplemented
|
484
|
+
assert device.main_mode == 1
|
485
|
+
assert device.heat_temp == 230
|
486
|
+
assert device.heat_sub_mode == 2
|
487
|
+
assert device.heat_fan_speed == 11
|
488
|
+
assert device.cool_sub_mode == 1
|
489
|
+
assert device.cool_fan_speed == 11
|
490
|
+
assert device.ap_sub_mode == 1
|
491
|
+
assert device.fan_speed_0 == 11
|
365
492
|
|
366
493
|
|
367
494
|
class Protect7470iTest(DeviceAwsTestBase):
|
@@ -407,3 +534,11 @@ class Protect7470iTest(DeviceAwsTestBase):
|
|
407
534
|
assert device.auto_regulated_humidity is NotImplemented
|
408
535
|
assert device.water_shortage is NotImplemented
|
409
536
|
assert device.wick_dry_mode is NotImplemented
|
537
|
+
assert device.main_mode is NotImplemented
|
538
|
+
assert device.heat_temp is NotImplemented
|
539
|
+
assert device.heat_sub_mode is NotImplemented
|
540
|
+
assert device.heat_fan_speed is NotImplemented
|
541
|
+
assert device.cool_sub_mode is NotImplemented
|
542
|
+
assert device.cool_fan_speed is NotImplemented
|
543
|
+
assert device.ap_sub_mode is NotImplemented
|
544
|
+
assert device.fan_speed_0 is NotImplemented
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{blueair_api-1.31.3 → blueair_api-1.32.0}/src/blueair_api/intermediate_representation_aws.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|