blebox-uniapi 2.4.2__tar.gz → 2.5.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.
Files changed (49) hide show
  1. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/HISTORY.rst +4 -0
  2. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/PKG-INFO +5 -1
  3. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/__init__.py +1 -1
  4. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/feature.py +4 -0
  5. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/sensor.py +38 -7
  6. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/PKG-INFO +5 -1
  7. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/setup.cfg +1 -1
  8. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/setup.py +1 -1
  9. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/CONTRIBUTING.rst +0 -0
  10. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/LICENSE +0 -0
  11. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/MANIFEST.in +0 -0
  12. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/README.rst +0 -0
  13. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/binary_sensor.py +0 -0
  14. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/box.py +0 -0
  15. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/box_types.py +0 -0
  16. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/button.py +0 -0
  17. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/climate.py +0 -0
  18. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/cover.py +0 -0
  19. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/error.py +0 -0
  20. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/jfollow.py +0 -0
  21. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/light.py +0 -0
  22. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/session.py +0 -0
  23. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi/switch.py +0 -0
  24. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/SOURCES.txt +0 -0
  25. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/dependency_links.txt +0 -0
  26. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/not-zip-safe +0 -0
  27. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/requires.txt +0 -0
  28. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/blebox_uniapi.egg-info/top_level.txt +0 -0
  29. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/Makefile +0 -0
  30. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/authors.rst +0 -0
  31. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/conf.py +0 -0
  32. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/contributing.rst +0 -0
  33. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/history.rst +0 -0
  34. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/index.rst +0 -0
  35. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/installation.rst +0 -0
  36. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/make.bat +0 -0
  37. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/readme.rst +0 -0
  38. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/docs/usage.rst +0 -0
  39. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_box.py +0 -0
  40. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_box_types.py +0 -0
  41. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_button.py +0 -0
  42. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_climate.py +0 -0
  43. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_cover.py +0 -0
  44. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_light.py +0 -0
  45. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_light_unit.py +0 -0
  46. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_sensor.py +0 -0
  47. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_session.py +0 -0
  48. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_switch.py +0 -0
  49. {blebox_uniapi-2.4.2 → blebox_uniapi-2.5.0}/tests/test_unknown.py +0 -0
@@ -1,6 +1,10 @@
1
1
  =======
2
2
  History
3
3
  =======
4
+ 2.5.0 (2024-08-20)
5
+ ------------------
6
+ * feature: expose sensor_id in sensors and alias in all features by @swistakm in https://github.com/blebox/blebox_uniapi/pull/176
7
+
4
8
  2.4.2 (2024-06-04)
5
9
  ------------------
6
10
  * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blebox_uniapi
3
- Version: 2.4.2
3
+ Version: 2.5.0
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
@@ -57,6 +57,10 @@ Credits
57
57
  =======
58
58
  History
59
59
  =======
60
+ 2.5.0 (2024-08-20)
61
+ ------------------
62
+ * feature: expose sensor_id in sensors and alias in all features by @swistakm in https://github.com/blebox/blebox_uniapi/pull/176
63
+
60
64
  2.4.2 (2024-06-04)
61
65
  ------------------
62
66
  * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
@@ -2,4 +2,4 @@
2
2
 
3
3
  __author__ = """BleBox"""
4
4
  __email__ = "opensource@blebox.eu"
5
- __version__ = "2.4.2"
5
+ __version__ = "2.5.0"
@@ -42,6 +42,10 @@ class Feature:
42
42
  def product(self) -> "Box":
43
43
  return self._product
44
44
 
45
+ @property
46
+ def alias(self):
47
+ return self._alias
48
+
45
49
  # TODO: (cleanup) move to product/box ?
46
50
  def raw_value(self, name: str) -> Any:
47
51
  product = self._product
@@ -73,7 +73,10 @@ class SensorFactory:
73
73
  }
74
74
 
75
75
  feature = constructor(
76
- product=product, alias=alias, methods=materialized_methods
76
+ product=product,
77
+ alias=alias,
78
+ methods=materialized_methods,
79
+ sensor_id=sensor_id,
77
80
  )
78
81
  object_list.append(feature)
79
82
 
@@ -98,11 +101,18 @@ class BaseSensor(Feature):
98
101
  _device_class: str
99
102
  _native_value: Union[float, int, str]
100
103
  _sensor_type: Optional[str]
104
+ _sensor_id: Optional[int]
101
105
 
102
106
  def __init__(
103
- self, product: "Box", alias: str, methods: dict, sensor_type: str = None
107
+ self,
108
+ product: "Box",
109
+ alias: str,
110
+ methods: dict,
111
+ sensor_type: str = None,
112
+ sensor_id: Optional[int] = None,
104
113
  ):
105
114
  self._sensor_type = sensor_type
115
+ self._sensor_id = sensor_id
106
116
  super().__init__(product, alias, methods)
107
117
 
108
118
  @property
@@ -117,6 +127,14 @@ class BaseSensor(Feature):
117
127
  def native_value(self):
118
128
  return self._native_value
119
129
 
130
+ @property
131
+ def sensor_id(self):
132
+ return self._sensor_id
133
+
134
+ @property
135
+ def probe_id(self):
136
+ return self.sensor_id
137
+
120
138
  @classmethod
121
139
  def many_from_config(cls, product, box_type_config, extended_state):
122
140
  raise NotImplementedError("Please use SensorFactory")
@@ -143,6 +161,7 @@ class GenericSensor(BaseSensor):
143
161
  product: "Box",
144
162
  alias: str,
145
163
  methods: dict,
164
+ sensor_id: Optional[int],
146
165
  *,
147
166
  # generalization params
148
167
  sensor_type: str,
@@ -150,7 +169,7 @@ class GenericSensor(BaseSensor):
150
169
  scale: float = 1,
151
170
  precision: Optional[int] = None,
152
171
  ):
153
- super().__init__(product, alias, methods)
172
+ super().__init__(product, alias, methods, sensor_id=sensor_id)
154
173
  self._unit = unit
155
174
  self._scale = scale
156
175
  self._precision = precision
@@ -200,8 +219,14 @@ class PowerConsumption(GenericSensor):
200
219
  class Temperature(BaseSensor):
201
220
  _current: Union[float, int, None]
202
221
 
203
- def __init__(self, product: "Box", alias: str, methods: dict):
204
- super().__init__(product, alias, methods)
222
+ def __init__(
223
+ self,
224
+ product: "Box",
225
+ alias: str,
226
+ methods: dict,
227
+ sensor_id: Optional[int] = None,
228
+ ):
229
+ super().__init__(product, alias, methods, sensor_id=sensor_id)
205
230
  self._unit = "celsius"
206
231
  self._device_class = "temperature"
207
232
 
@@ -227,8 +252,14 @@ class Temperature(BaseSensor):
227
252
  class AirQuality(BaseSensor):
228
253
  _pm: Optional[int]
229
254
 
230
- def __init__(self, product: "Box", alias: str, methods: dict):
231
- super().__init__(product, alias, methods)
255
+ def __init__(
256
+ self,
257
+ product: "Box",
258
+ alias: str,
259
+ methods: dict,
260
+ sensor_id: Optional[str] = None,
261
+ ):
262
+ super().__init__(product, alias, methods, sensor_id)
232
263
  self._unit = "concentration_of_mp"
233
264
  self._device_class = alias
234
265
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blebox_uniapi
3
- Version: 2.4.2
3
+ Version: 2.5.0
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
@@ -57,6 +57,10 @@ Credits
57
57
  =======
58
58
  History
59
59
  =======
60
+ 2.5.0 (2024-08-20)
61
+ ------------------
62
+ * feature: expose sensor_id in sensors and alias in all features by @swistakm in https://github.com/blebox/blebox_uniapi/pull/176
63
+
60
64
  2.4.2 (2024-06-04)
61
65
  ------------------
62
66
  * fix: add missing support for active power sensors on switchbox/switchboxd devices by @swistakm in https://github.com/blebox/blebox_uniapi/pull/175
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 2.4.2
2
+ current_version = 2.5.0
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.2",
26
+ version="2.5.0",
27
27
  author="BleBox",
28
28
  author_email="opensource@blebox.eu",
29
29
  python_requires=">=3.9",
File without changes
File without changes
File without changes