blebox-uniapi 2.4.0__tar.gz → 2.4.2__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.
Files changed (49) hide show
  1. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/HISTORY.rst +8 -0
  2. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/PKG-INFO +9 -13
  3. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/README.rst +0 -12
  4. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/__init__.py +1 -1
  5. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/box_types.py +21 -7
  6. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/sensor.py +6 -13
  7. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/PKG-INFO +9 -13
  8. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/setup.cfg +1 -1
  9. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/setup.py +1 -1
  10. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/CONTRIBUTING.rst +0 -0
  11. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/LICENSE +0 -0
  12. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/MANIFEST.in +0 -0
  13. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/binary_sensor.py +0 -0
  14. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/box.py +0 -0
  15. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/button.py +0 -0
  16. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/climate.py +0 -0
  17. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/cover.py +0 -0
  18. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/error.py +0 -0
  19. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/feature.py +0 -0
  20. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/jfollow.py +0 -0
  21. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/light.py +0 -0
  22. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/session.py +0 -0
  23. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi/switch.py +0 -0
  24. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/SOURCES.txt +0 -0
  25. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/dependency_links.txt +0 -0
  26. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/not-zip-safe +0 -0
  27. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/requires.txt +0 -0
  28. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/blebox_uniapi.egg-info/top_level.txt +0 -0
  29. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/Makefile +0 -0
  30. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/authors.rst +0 -0
  31. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/conf.py +0 -0
  32. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/contributing.rst +0 -0
  33. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/history.rst +0 -0
  34. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/index.rst +0 -0
  35. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/installation.rst +0 -0
  36. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/make.bat +0 -0
  37. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/readme.rst +0 -0
  38. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/docs/usage.rst +0 -0
  39. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_box.py +0 -0
  40. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_box_types.py +0 -0
  41. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_button.py +0 -0
  42. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_climate.py +0 -0
  43. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_cover.py +0 -0
  44. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_light.py +0 -0
  45. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_light_unit.py +0 -0
  46. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_sensor.py +0 -0
  47. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_session.py +0 -0
  48. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_switch.py +0 -0
  49. {blebox_uniapi-2.4.0 → blebox_uniapi-2.4.2}/tests/test_unknown.py +0 -0
@@ -1,6 +1,14 @@
1
1
  =======
2
2
  History
3
3
  =======
4
+ 2.4.2 (2024-06-04)
5
+ ------------------
6
+ * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
7
+
8
+ 2.4.1 (2024-06-04)
9
+ ------------------
10
+ * fix: rectify ambiguity around powerConsumption and wind sensor types
11
+
4
12
  2.4.0 (2024-06-03)
5
13
  ------------------
6
14
  * Fix: Refactor sensor_factory by @Pastucha in https://github.com/blebox/blebox_uniapi/pull/163
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blebox_uniapi
3
- Version: 2.4.0
3
+ Version: 2.4.2
4
4
  Summary: Python API for accessing BleBox smart home devices
5
5
  Home-page: https://github.com/blebox/blebox_uniapi
6
6
  Author: BleBox
@@ -23,20 +23,9 @@ Requires-Dist: jmespath>1.0.0
23
23
  BleBox Python UniAPI
24
24
  ====================
25
25
 
26
-
27
26
  .. image:: https://img.shields.io/pypi/v/blebox_uniapi.svg
28
27
  :target: https://pypi.python.org/pypi/blebox_uniapi
29
28
 
30
- .. image:: https://travis-ci.com/blebox/blebox_uniapi.svg?branch=master
31
- :target: https://travis-ci.com/blebox/blebox_uniapi
32
-
33
- .. image:: https://readthedocs.org/projects/blebox-uniapi/badge/?version=latest
34
- :target: https://blebox-uniapi.readthedocs.io/en/latest/?badge=latest
35
- :alt: Documentation Status
36
-
37
-
38
-
39
-
40
29
  Python API for accessing BleBox smart home devices
41
30
 
42
31
 
@@ -60,7 +49,6 @@ Contributions are welcome!
60
49
  Credits
61
50
  -------
62
51
 
63
-
64
52
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
65
53
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
66
54
  .. _`11 BleBox smart home devices`: https://blebox.eu/produkty/?lang=en
@@ -69,6 +57,14 @@ Credits
69
57
  =======
70
58
  History
71
59
  =======
60
+ 2.4.2 (2024-06-04)
61
+ ------------------
62
+ * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
63
+
64
+ 2.4.1 (2024-06-04)
65
+ ------------------
66
+ * fix: rectify ambiguity around powerConsumption and wind sensor types
67
+
72
68
  2.4.0 (2024-06-03)
73
69
  ------------------
74
70
  * Fix: Refactor sensor_factory by @Pastucha in https://github.com/blebox/blebox_uniapi/pull/163
@@ -2,20 +2,9 @@
2
2
  BleBox Python UniAPI
3
3
  ====================
4
4
 
5
-
6
5
  .. image:: https://img.shields.io/pypi/v/blebox_uniapi.svg
7
6
  :target: https://pypi.python.org/pypi/blebox_uniapi
8
7
 
9
- .. image:: https://travis-ci.com/blebox/blebox_uniapi.svg?branch=master
10
- :target: https://travis-ci.com/blebox/blebox_uniapi
11
-
12
- .. image:: https://readthedocs.org/projects/blebox-uniapi/badge/?version=latest
13
- :target: https://blebox-uniapi.readthedocs.io/en/latest/?badge=latest
14
- :alt: Documentation Status
15
-
16
-
17
-
18
-
19
8
  Python API for accessing BleBox smart home devices
20
9
 
21
10
 
@@ -39,7 +28,6 @@ Contributions are welcome!
39
28
  Credits
40
29
  -------
41
30
 
42
-
43
31
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
44
32
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
45
33
  .. _`11 BleBox smart home devices`: https://blebox.eu/produkty/?lang=en
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """BleBox"""
4
4
  __email__ = "opensource@blebox.eu"
5
- __version__ = "2.4.0"
5
+ __version__ = "2.4.2"
@@ -280,7 +280,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
280
280
  [
281
281
  "switchBox.energy",
282
282
  {
283
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value",
283
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
284
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value",
285
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
284
286
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
285
287
  "measurement_enabled": "powerMeasuring.enabled",
286
288
  },
@@ -305,7 +307,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
305
307
  [
306
308
  "switchBox.energy",
307
309
  {
308
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value",
310
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
311
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value",
312
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
309
313
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
310
314
  "measurement_enabled": "powerMeasuring.enabled",
311
315
  },
@@ -330,7 +334,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
330
334
  [
331
335
  "switchBox.energy",
332
336
  {
333
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value",
337
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
338
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value",
339
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
334
340
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
335
341
  "measurement_enabled": "powerMeasuring.enabled",
336
342
  },
@@ -357,7 +363,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
357
363
  [
358
364
  "switchBox.energy",
359
365
  {
360
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value ",
366
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
367
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value ",
368
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
361
369
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
362
370
  "measurement_enabled": "powerMeasuring.enabled",
363
371
  },
@@ -392,7 +400,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
392
400
  [
393
401
  "switchBox.energy",
394
402
  {
395
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value ",
403
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
404
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value ",
405
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
396
406
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
397
407
  "measurement_enabled": "powerMeasuring.enabled",
398
408
  },
@@ -424,7 +434,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
424
434
  [
425
435
  "switchBox.energy",
426
436
  {
427
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value ",
437
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
438
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value ",
439
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
428
440
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
429
441
  "measurement_enabled": "powerMeasuring.enabled",
430
442
  },
@@ -456,7 +468,9 @@ BOX_TYPE_CONF: dict[str, dict[int, dict[str, Any]]] = {
456
468
  [
457
469
  "switchBox.energy",
458
470
  {
459
- "powerMeasurement": lambda x: "powerMeasuring.powerConsumption[0]|value ",
471
+ # note: switchbox/switchboxD sensors are currently not indexed (singletons)
472
+ "powerConsumption": lambda x: "powerMeasuring.powerConsumption[0]|value ",
473
+ "activePower": lambda x: "sensors[?type == 'activePower']|[0]|value",
460
474
  "periodS": "powerMeasuring.powerConsumption[0]|periodS",
461
475
  "measurement_enabled": "powerMeasuring.enabled",
462
476
  },
@@ -35,14 +35,16 @@ class SensorFactory:
35
35
  # note: probably we should iterate extended state in future if there
36
36
  # are other api flavours other than multiSensor that provide sensors
37
37
  states = extended_state.get("multiSensor", {}).get("sensors", [])
38
-
38
+ # note: but for now we are only able to support non-multisensor devices
39
+ # that provide sensor data in extended data payload root
40
+ states.extend(extended_state.get("sensors", []))
39
41
  # note: power measuring feature predates multiSensor API, so we need a small
40
42
  # shim to adapt older shape of power measuring schema to the new sensor API
41
43
  if "powerMeasuring" in extended_state:
42
44
  power_states = extended_state["powerMeasuring"].get("powerConsumption", [])
43
45
  # note: be careful of names as this has been historically named differently
44
46
  # in home-assistant
45
- states.extend({"type": "powerMeasurement", **s} for s in power_states)
47
+ states.extend({"type": "powerConsumption", **s} for s in power_states)
46
48
  return states
47
49
 
48
50
  @classmethod
@@ -133,6 +135,7 @@ class BaseSensor(Feature):
133
135
  @SensorFactory.register("forwardActiveEnergy", unit="kWh")
134
136
  @SensorFactory.register("illuminance", unit="lx", scale=100)
135
137
  @SensorFactory.register("humidity", unit="percentage", scale=100)
138
+ @SensorFactory.register("wind", unit="m/s", scale=10)
136
139
  class GenericSensor(BaseSensor):
137
140
  def __init__(
138
141
  # base sensor params
@@ -173,17 +176,7 @@ class GenericSensor(BaseSensor):
173
176
  self._native_value = native
174
177
 
175
178
 
176
- @SensorFactory.register("wind", unit="m/s", scale=10)
177
- class Wind(GenericSensor):
178
- @property
179
- def device_class(self):
180
- # compat/legacy: this sensor is advertised in homeassistant as wind speed
181
- # despite different sensor-type naming. Keep it consistent until we rectiify
182
- # this upstream
183
- return "wind_speed"
184
-
185
-
186
- @SensorFactory.register("powerMeasurement", unit="kWh")
179
+ @SensorFactory.register("powerConsumption", unit="kWh")
187
180
  class PowerConsumption(GenericSensor):
188
181
  # note: almost the same as typical generic sensor but also provides extra property
189
182
  # to read last reset value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blebox_uniapi
3
- Version: 2.4.0
3
+ Version: 2.4.2
4
4
  Summary: Python API for accessing BleBox smart home devices
5
5
  Home-page: https://github.com/blebox/blebox_uniapi
6
6
  Author: BleBox
@@ -23,20 +23,9 @@ Requires-Dist: jmespath>1.0.0
23
23
  BleBox Python UniAPI
24
24
  ====================
25
25
 
26
-
27
26
  .. image:: https://img.shields.io/pypi/v/blebox_uniapi.svg
28
27
  :target: https://pypi.python.org/pypi/blebox_uniapi
29
28
 
30
- .. image:: https://travis-ci.com/blebox/blebox_uniapi.svg?branch=master
31
- :target: https://travis-ci.com/blebox/blebox_uniapi
32
-
33
- .. image:: https://readthedocs.org/projects/blebox-uniapi/badge/?version=latest
34
- :target: https://blebox-uniapi.readthedocs.io/en/latest/?badge=latest
35
- :alt: Documentation Status
36
-
37
-
38
-
39
-
40
29
  Python API for accessing BleBox smart home devices
41
30
 
42
31
 
@@ -60,7 +49,6 @@ Contributions are welcome!
60
49
  Credits
61
50
  -------
62
51
 
63
-
64
52
  .. _Cookiecutter: https://github.com/audreyr/cookiecutter
65
53
  .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
66
54
  .. _`11 BleBox smart home devices`: https://blebox.eu/produkty/?lang=en
@@ -69,6 +57,14 @@ Credits
69
57
  =======
70
58
  History
71
59
  =======
60
+ 2.4.2 (2024-06-04)
61
+ ------------------
62
+ * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
63
+
64
+ 2.4.1 (2024-06-04)
65
+ ------------------
66
+ * fix: rectify ambiguity around powerConsumption and wind sensor types
67
+
72
68
  2.4.0 (2024-06-03)
73
69
  ------------------
74
70
  * Fix: Refactor sensor_factory by @Pastucha in https://github.com/blebox/blebox_uniapi/pull/163
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 2.4.0
2
+ current_version = 2.4.2
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -23,7 +23,7 @@ test_requirements = [
23
23
  ]
24
24
 
25
25
  setup(
26
- version="2.4.0",
26
+ version="2.4.2",
27
27
  author="BleBox",
28
28
  author_email="opensource@blebox.eu",
29
29
  python_requires=">=3.9",
File without changes
File without changes