aioWiserHeatAPI 1.5.18__tar.gz → 1.5.19__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 (57) hide show
  1. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/PKG-INFO +8 -3
  2. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/README.md +6 -1
  3. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/__init__.py +1 -1
  4. aiowiserheatapi-1.5.19/aioWiserHeatAPI/button_panel.py +43 -0
  5. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/const.py +1 -0
  6. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/devices.py +15 -16
  7. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/rest_controller.py +9 -7
  8. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/PKG-INFO +8 -3
  9. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/SOURCES.txt +1 -0
  10. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/setup.py +1 -1
  11. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/LICENSE +0 -0
  12. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/automation.py +0 -0
  13. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/binary_sensor.py +0 -0
  14. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/boiler_interface.py +0 -0
  15. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/cli.py +0 -0
  16. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/discovery.py +0 -0
  17. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/exceptions.py +0 -0
  18. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/heating.py +0 -0
  19. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/heating_actuator.py +0 -0
  20. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/__init__.py +0 -0
  21. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/automations.py +0 -0
  22. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/battery.py +0 -0
  23. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
  24. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/cloud.py +0 -0
  25. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/device.py +0 -0
  26. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/equipment.py +0 -0
  27. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
  28. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/firmware.py +0 -0
  29. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/gps.py +0 -0
  30. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/misc.py +0 -0
  31. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/network.py +0 -0
  32. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/opentherm.py +0 -0
  33. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/signal.py +0 -0
  34. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/special_times.py +0 -0
  35. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/status.py +0 -0
  36. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/temp.py +0 -0
  37. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/version.py +0 -0
  38. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
  39. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/hot_water.py +0 -0
  40. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/light.py +0 -0
  41. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/moments.py +0 -0
  42. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/pte.py +0 -0
  43. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/room.py +0 -0
  44. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/roomstat.py +0 -0
  45. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/schedule.py +0 -0
  46. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/shutter.py +0 -0
  47. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/smartplug.py +0 -0
  48. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/smartvalve.py +0 -0
  49. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/smokealarm.py +0 -0
  50. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/system.py +0 -0
  51. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/ufh.py +0 -0
  52. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI/wiserhub.py +0 -0
  53. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
  54. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
  55. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/requires.txt +0 -0
  56. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
  57. {aiowiserheatapi-1.5.18 → aiowiserheatapi-1.5.19}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.18
3
+ Version: 1.5.19
4
4
  Summary: An AsyncIO API for controlling the Drayton Wiser Heating system
5
5
  Home-page: https://github.com/msp1974/aioWiserHeatAPI
6
6
  Author: Mark Parker
@@ -10,7 +10,7 @@ Classifier: Intended Audience :: Developers
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.11
13
+ Requires-Python: >=3.12
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: zeroconf>=0.131.0
@@ -18,7 +18,7 @@ Requires-Dist: aiohttp>=3.9.3
18
18
  Requires-Dist: aiofiles>=23.2.1
19
19
  Requires-Dist: pyyaml>=6.0.1
20
20
 
21
- # Drayton Wiser Hub API Async v1.5.18
21
+ # Drayton Wiser Hub API Async v1.5.19
22
22
 
23
23
  This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK.
24
24
 
@@ -72,6 +72,11 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
72
72
 
73
73
  ## Changelog
74
74
 
75
+ ### v1.5.19
76
+ * Fixed error when BoilerInterface does not provide DeviceId field
77
+ * Fixed not supporting non ascii characters in schedule names
78
+ * Added ButtonPanel device support
79
+
75
80
  ### v1.5.18
76
81
 
77
82
  * Better handle client response exeption and fit into retry routing
@@ -1,4 +1,4 @@
1
- # Drayton Wiser Hub API Async v1.5.18
1
+ # Drayton Wiser Hub API Async v1.5.19
2
2
 
3
3
  This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK.
4
4
 
@@ -52,6 +52,11 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
52
52
 
53
53
  ## Changelog
54
54
 
55
+ ### v1.5.19
56
+ * Fixed error when BoilerInterface does not provide DeviceId field
57
+ * Fixed not supporting non ascii characters in schedule names
58
+ * Added ButtonPanel device support
59
+
55
60
  ### v1.5.18
56
61
 
57
62
  * Better handle client response exeption and fit into retry routing
@@ -3,6 +3,6 @@ import logging
3
3
  name = "aioWiserHeatAPI"
4
4
  __all__ = ["wiserAPI", "wiserDiscovery"]
5
5
 
6
- __VERSION__ = "1.5.18"
6
+ __VERSION__ = "1.5.19"
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
@@ -0,0 +1,43 @@
1
+ from typing import Any
2
+
3
+ from .helpers.device import _WiserDevice
4
+
5
+
6
+ class _WiserButtonPanel(_WiserDevice):
7
+ """Class representing a Wiser Button Panel"""
8
+
9
+ @property
10
+ def number_of_gangs(self) -> list[int]:
11
+ """Number of gangs."""
12
+ return self._device_type_data.get("NumberOfGangs")
13
+
14
+ @property
15
+ def events(self) -> list[dict[str, Any]]:
16
+ """Events info."""
17
+ return self._device_type_data.get("Events")
18
+
19
+
20
+ class _WiserButtonPanelCollection:
21
+ """Class holding all Wiser Button Panels"""
22
+
23
+ def __init__(self):
24
+ self._items = []
25
+
26
+ @property
27
+ def all(self) -> list[_WiserButtonPanel]:
28
+ return list(self._items)
29
+
30
+ @property
31
+ def count(self) -> int:
32
+ return len(self.all)
33
+
34
+ def get_by_id(self, id: int) -> _WiserButtonPanel:
35
+ """
36
+ Gets a button panel object from the sensor id
37
+ param id: id of button panel
38
+ return: _WiserButtonPanel object
39
+ """
40
+ try:
41
+ return [buttonpanel for buttonpanel in self.all if buttonpanel.id == id][0]
42
+ except IndexError:
43
+ return None
@@ -105,6 +105,7 @@ WISERPOWERTAGENERGY = "PTE/{}"
105
105
  WISERSMOKEALARM = "SmokeAlarmDevice/{}"
106
106
  WISERBINARYSENSOR = "BinarySensor/{}"
107
107
  WISERBOILERINTERFACE = "BoilerInterface/{}"
108
+ WISERBUTTONPANEL = "ButtonPanel/{}"
108
109
 
109
110
 
110
111
  # Enums
@@ -4,15 +4,14 @@ Module to manage all devices
4
4
 
5
5
  import enum
6
6
 
7
- from .binary_sensor import (
8
- _WiserBinarySensorCollection,
9
- _WiserWindowDoorSensor,
10
- )
7
+ from .binary_sensor import _WiserBinarySensorCollection, _WiserWindowDoorSensor
11
8
  from .boiler_interface import _WiserBoilerInterface, _WiserBoilerInterfaceCollection
9
+ from .button_panel import _WiserButtonPanel, _WiserButtonPanelCollection
12
10
  from .const import (
13
11
  TEXT_UNKNOWN,
14
12
  WISERBINARYSENSOR,
15
13
  WISERBOILERINTERFACE,
14
+ WISERBUTTONPANEL,
16
15
  WISERHEATINGACTUATOR,
17
16
  WISERLIGHT,
18
17
  WISERPOWERTAGENERGY,
@@ -23,10 +22,7 @@ from .const import (
23
22
  WISERSMOKEALARM,
24
23
  WISERUFHCONTROLLER,
25
24
  )
26
- from .heating_actuator import (
27
- _WiserHeatingActuator,
28
- _WiserHeatingActuatorCollection,
29
- )
25
+ from .heating_actuator import _WiserHeatingActuator, _WiserHeatingActuatorCollection
30
26
  from .helpers.device import _WiserDevice
31
27
  from .light import _WiserDimmableLight, _WiserLight, _WiserLightCollection
32
28
  from .pte import _WiserPowerTagEnergy, _WiserPowerTagEnergyCollection
@@ -54,6 +50,7 @@ class _WiserDeviceTypeEnum(enum.Enum):
54
50
  WindowDoorSensor = "BinarySensor"
55
51
  BoilerInterface = "BoilerInterface"
56
52
  CFMT = "HeatingActuator"
53
+ ButtonPanel = "ButtonPanel"
57
54
 
58
55
 
59
56
  PRODUCT_TYPE_CONFIG = {
@@ -93,47 +90,40 @@ PRODUCT_TYPE_CONFIG = {
93
90
  "class": _WiserShutter,
94
91
  "collection": _WiserShutterCollection,
95
92
  "endpoint": WISERSHUTTER,
96
- "device_id_field": "DeviceId",
97
93
  "schedule_type": WiserScheduleTypeEnum.level,
98
94
  },
99
95
  "OnOffLight": {
100
96
  "class": _WiserLight,
101
97
  "collection": _WiserLightCollection,
102
98
  "endpoint": WISERLIGHT,
103
- "device_id_field": "DeviceId",
104
99
  "schedule_type": WiserScheduleTypeEnum.level,
105
100
  },
106
101
  "DimmableLight": {
107
102
  "class": _WiserDimmableLight,
108
103
  "collection": _WiserLightCollection,
109
104
  "endpoint": WISERLIGHT,
110
- "device_id_field": "DeviceId",
111
105
  "schedule_type": WiserScheduleTypeEnum.level,
112
106
  },
113
107
  "PowerTagE": {
114
108
  "class": _WiserPowerTagEnergy,
115
109
  "collection": _WiserPowerTagEnergyCollection,
116
110
  "endpoint": WISERPOWERTAGENERGY,
117
- "device_id_field": "DeviceId",
118
111
  "has_v2_equipment": True,
119
112
  },
120
113
  "SmokeAlarmDevice": {
121
114
  "class": _WiserSmokeAlarm,
122
115
  "collection": _WiserSmokeAlarmCollection,
123
116
  "endpoint": WISERSMOKEALARM,
124
- "device_id_field": "DeviceId",
125
117
  },
126
118
  "WindowDoorSensor": {
127
119
  "class": _WiserWindowDoorSensor,
128
120
  "collection": _WiserBinarySensorCollection,
129
121
  "endpoint": WISERBINARYSENSOR,
130
- "device_id_field": "DeviceId",
131
122
  },
132
123
  "BoilerInterface": {
133
124
  "class": _WiserBoilerInterface,
134
125
  "collection": _WiserBoilerInterfaceCollection,
135
126
  "endpoint": WISERBOILERINTERFACE,
136
- "device_id_field": "DeviceId",
137
127
  },
138
128
  "CFMT": {
139
129
  "class": _WiserHeatingActuator,
@@ -142,6 +132,11 @@ PRODUCT_TYPE_CONFIG = {
142
132
  "heating": True,
143
133
  "has_v2_equipment": True,
144
134
  },
135
+ "ButtonPanel": {
136
+ "class": _WiserButtonPanel,
137
+ "collection": _WiserButtonPanelCollection,
138
+ "endpoint": WISERBUTTONPANEL,
139
+ },
145
140
  }
146
141
 
147
142
 
@@ -196,10 +191,14 @@ class _WiserDeviceCollection:
196
191
  for device_info in self._domain_data.get(
197
192
  _WiserDeviceTypeEnum[device_type].value
198
193
  )
199
- if device_info.get(device_config.get("device_id_field", "id"))
194
+ if device_info.get("DeviceId", device_info.get("id"))
200
195
  == device.get("id")
201
196
  ]
202
197
 
198
+ # Safety net to prevent error if device info not found
199
+ if not device_info:
200
+ continue
201
+
203
202
  # Get class to create and collection to append for device
204
203
  device_class = PRODUCT_TYPE_CONFIG[device_type].get("class")
205
204
 
@@ -175,10 +175,10 @@ class _WiserRestController(object):
175
175
 
176
176
  # if data is not None:
177
177
  if data:
178
- kwargs["json"] = data
178
+ kwargs["data"] = json.dumps(data, ensure_ascii=False).encode("utf8")
179
179
  kwargs["headers"].update(
180
180
  {
181
- "Content-Type": "application/json;charset=UTF-8",
181
+ "Content-Type": "application/json",
182
182
  }
183
183
  )
184
184
  if self._timeout is not None:
@@ -247,19 +247,21 @@ class _WiserRestController(object):
247
247
  data: dict,
248
248
  raise_for_endpoint_error: bool = True,
249
249
  ):
250
- if response.status == 400:
250
+ status = response.status
251
+
252
+ if status == 400:
251
253
  _LOGGER.debug("400 error")
252
- if response.status == 401:
254
+ if status == 401:
253
255
  raise WiserHubAuthenticationError(
254
256
  f"Error authenticating to Wiser Hub "
255
257
  f"{self._wiser_connection_info.host}. Check your secret key"
256
258
  )
257
- elif response.status == 404 and raise_for_endpoint_error:
259
+ elif status == 404 and raise_for_endpoint_error:
258
260
  raise WiserHubRESTError(
259
261
  f"Rest endpoint not found on Wiser Hub "
260
262
  f"{self._wiser_connection_info.host} for url {url}"
261
263
  )
262
- elif response.status == 408:
264
+ elif status == 408:
263
265
  raise WiserHubConnectionError(
264
266
  f"Connection timed out trying to communicate with Wiser Hub "
265
267
  f"{self._wiser_connection_info.host} for url {url}"
@@ -268,7 +270,7 @@ class _WiserRestController(object):
268
270
  raise WiserHubRESTError(
269
271
  f"Unknown error communicating with Wiser Hub "
270
272
  f"{self._wiser_connection_info.host} for url {url} with data {data}. "
271
- f"Error code is: {response.status}"
273
+ f"Error code is: {status}"
272
274
  )
273
275
 
274
276
  async def get_hub_data(self, url: str, raise_for_endpoint_error: bool = True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.18
3
+ Version: 1.5.19
4
4
  Summary: An AsyncIO API for controlling the Drayton Wiser Heating system
5
5
  Home-page: https://github.com/msp1974/aioWiserHeatAPI
6
6
  Author: Mark Parker
@@ -10,7 +10,7 @@ Classifier: Intended Audience :: Developers
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.11
13
+ Requires-Python: >=3.12
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
  Requires-Dist: zeroconf>=0.131.0
@@ -18,7 +18,7 @@ Requires-Dist: aiohttp>=3.9.3
18
18
  Requires-Dist: aiofiles>=23.2.1
19
19
  Requires-Dist: pyyaml>=6.0.1
20
20
 
21
- # Drayton Wiser Hub API Async v1.5.18
21
+ # Drayton Wiser Hub API Async v1.5.19
22
22
 
23
23
  This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK.
24
24
 
@@ -72,6 +72,11 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
72
72
 
73
73
  ## Changelog
74
74
 
75
+ ### v1.5.19
76
+ * Fixed error when BoilerInterface does not provide DeviceId field
77
+ * Fixed not supporting non ascii characters in schedule names
78
+ * Added ButtonPanel device support
79
+
75
80
  ### v1.5.18
76
81
 
77
82
  * Better handle client response exeption and fit into retry routing
@@ -6,6 +6,7 @@ aioWiserHeatAPI/__init__.py
6
6
  aioWiserHeatAPI/automation.py
7
7
  aioWiserHeatAPI/binary_sensor.py
8
8
  aioWiserHeatAPI/boiler_interface.py
9
+ aioWiserHeatAPI/button_panel.py
9
10
  aioWiserHeatAPI/cli.py
10
11
  aioWiserHeatAPI/const.py
11
12
  aioWiserHeatAPI/devices.py
@@ -45,7 +45,7 @@ setuptools.setup(
45
45
  "aiofiles>=23.2.1",
46
46
  "pyyaml>=6.0.1",
47
47
  ],
48
- python_requires=">=3.11",
48
+ python_requires=">=3.12",
49
49
  entry_points={
50
50
  "console_scripts": ["wiser = aioWiserHeatAPI.cli:main"],
51
51
  },