aioWiserHeatAPI 1.5.1__tar.gz → 1.5.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 (52) hide show
  1. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/PKG-INFO +12 -9
  2. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/README.md +5 -1
  3. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/__init__.py +1 -1
  4. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/rest_controller.py +38 -38
  5. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/wiserhub.py +18 -9
  6. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI.egg-info/PKG-INFO +12 -9
  7. aioWiserHeatAPI-1.5.2/aioWiserHeatAPI.egg-info/requires.txt +4 -0
  8. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/setup.py +6 -7
  9. aioWiserHeatAPI-1.5.1/aioWiserHeatAPI.egg-info/requires.txt +0 -5
  10. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/LICENSE +0 -0
  11. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/cli.py +0 -0
  12. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/const.py +0 -0
  13. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/devices.py +0 -0
  14. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/discovery.py +0 -0
  15. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/exceptions.py +0 -0
  16. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/heating.py +0 -0
  17. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/heating_actuator.py +0 -0
  18. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/__init__.py +0 -0
  19. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/automations.py +0 -0
  20. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/battery.py +0 -0
  21. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
  22. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/cloud.py +0 -0
  23. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/device.py +0 -0
  24. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/equipment.py +0 -0
  25. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
  26. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/firmware.py +0 -0
  27. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/gps.py +0 -0
  28. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/misc.py +0 -0
  29. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/network.py +0 -0
  30. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/opentherm.py +0 -0
  31. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/signal.py +0 -0
  32. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/special_times.py +0 -0
  33. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/status.py +0 -0
  34. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/temp.py +0 -0
  35. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
  36. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/hot_water.py +0 -0
  37. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/light.py +0 -0
  38. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/moments.py +0 -0
  39. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/pte.py +0 -0
  40. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/room.py +0 -0
  41. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/roomstat.py +0 -0
  42. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/schedule.py +0 -0
  43. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/shutter.py +0 -0
  44. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/smartplug.py +0 -0
  45. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/smartvalve.py +0 -0
  46. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/system.py +0 -0
  47. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI/ufh.py +0 -0
  48. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI.egg-info/SOURCES.txt +0 -0
  49. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
  50. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
  51. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
  52. {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.2}/setup.cfg +0 -0
@@ -1,25 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.1
3
+ Version: 1.5.2
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
7
7
  Author-email: msparker@sky.com
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3.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.10
13
+ Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: zeroconf>=0.47.1
17
- Requires-Dist: aiohttp>=3.8.1
18
- Requires-Dist: aiofiles>=0.8.0
19
- Requires-Dist: pyyaml>=6.0
20
- Requires-Dist: httpx>=0.25.0
16
+ Requires-Dist: zeroconf>=0.127.0
17
+ Requires-Dist: aiohttp>=3.9.1
18
+ Requires-Dist: aiofiles>=23.2.1
19
+ Requires-Dist: pyyaml>=6.0.1
21
20
 
22
- # Drayton Wiser Hub API Async v1.5.1
21
+ # Drayton Wiser Hub API Async v1.5.2
23
22
 
24
23
  This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK.
25
24
 
@@ -73,6 +72,10 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
73
72
 
74
73
  ## Changelog
75
74
 
75
+ ### v1.5.2
76
+
77
+ * Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
78
+
76
79
  ### v1.5.1
77
80
 
78
81
  * Fix nuances with httpx
@@ -1,4 +1,4 @@
1
- # Drayton Wiser Hub API Async v1.5.1
1
+ # Drayton Wiser Hub API Async v1.5.2
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,10 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
52
52
 
53
53
  ## Changelog
54
54
 
55
+ ### v1.5.2
56
+
57
+ * Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
58
+
55
59
  ### v1.5.1
56
60
 
57
61
  * Fix nuances with httpx
@@ -3,6 +3,6 @@ import logging
3
3
  name = "aioWiserHeatAPI"
4
4
  __all__ = ["wiserAPI", "wiserDiscovery"]
5
5
 
6
- __VERSION__ = "1.5.1"
6
+ __VERSION__ = "1.5.2"
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
@@ -1,12 +1,10 @@
1
1
  import asyncio
2
2
  import enum
3
3
  import json
4
- import re
5
4
  from dataclasses import dataclass
6
- from typing import Any, Optional, cast
5
+ from typing import Optional
7
6
 
8
7
  import aiohttp
9
- import httpx
10
8
 
11
9
  from aioWiserHeatAPI.helpers.extra_config import _WiserExtraConfig
12
10
 
@@ -57,14 +55,12 @@ class _WiserRestController(object):
57
55
 
58
56
  def __init__(
59
57
  self,
60
- session: Optional[aiohttp.ClientSession] = None,
61
58
  timeout: Optional[float] = REST_TIMEOUT,
62
59
  wiser_connection_info: Optional[_WiserConnectionInfo] = None,
63
60
  ):
64
61
  self._wiser_connection_info = wiser_connection_info
65
62
  self._api_parameters = WiserAPIParams()
66
-
67
- self._timeout = timeout # aiohttp.ClientTimeout(total=timeout)
63
+ self._timeout = aiohttp.ClientTimeout(total=timeout)
68
64
  self._hub_name = None
69
65
  self._extra_config_file = None
70
66
  self._extra_config: _WiserExtraConfig = None
@@ -88,12 +84,11 @@ class _WiserRestController(object):
88
84
  self._wiser_connection_info.port,
89
85
  )
90
86
 
91
- kwargs = {
92
- "headers": {
93
- "SECRET": self._wiser_connection_info.secret,
94
- "Content-Type": "application/json;charset=UTF-8",
95
- "Connection": "close",
96
- }
87
+ kwargs = {}
88
+
89
+ kwargs["headers"] = {
90
+ "SECRET": self._wiser_connection_info.secret,
91
+ "Content-Type": "application/json;charset=UTF-8",
97
92
  }
98
93
 
99
94
  if data is not None:
@@ -103,35 +98,40 @@ class _WiserRestController(object):
103
98
  kwargs["timeout"] = self._timeout
104
99
 
105
100
  try:
106
- async with httpx.AsyncClient() as client:
107
- response = await getattr(client, action.value)(
101
+ async with aiohttp.ClientSession(
102
+ version=aiohttp.HttpVersion10,
103
+ ) as session:
104
+ async with getattr(session, action.value)(
108
105
  url,
109
106
  **kwargs,
110
- )
111
-
112
- if response.status_code >= 400:
113
- self._process_nok_response(
114
- response, url, data, raise_for_endpoint_error
115
- )
116
- else:
117
- content = await response.aread()
118
- if len(content) > 0:
119
- response = content.decode("utf-8", "ignore").encode(
120
- "utf-8"
107
+ ) as response:
108
+ if not response.ok:
109
+ self._process_nok_response(
110
+ response, url, data, raise_for_endpoint_error
121
111
  )
122
- return json.loads(response)
123
112
  else:
124
- return {}
125
- return {}
113
+ content = await response.read()
114
+ if len(content) > 0:
115
+ response = content.decode(
116
+ "utf-8", "ignore"
117
+ ).encode("utf-8")
118
+ return json.loads(response)
119
+ else:
120
+ return {}
121
+ return {}
126
122
 
127
- except httpx.TimeoutException as ex:
123
+ except asyncio.TimeoutError as ex:
128
124
  raise WiserHubConnectionError(
129
- f"Connection timeout trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}. Error is {ex}"
130
- ) from ex
131
- except httpx.NetworkError as ex:
125
+ f"Connection timeout trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}"
126
+ )
127
+ except aiohttp.ClientResponseError as ex:
128
+ raise WiserHubConnectionError(
129
+ f"Response error trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}. Error is {ex}"
130
+ )
131
+ except aiohttp.ClientConnectorError as ex:
132
132
  raise WiserHubConnectionError(
133
- f"Connection error trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}. Error is {ex}"
134
- ) from ex
133
+ f"Connection error trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}. Error is {ex}"
134
+ )
135
135
 
136
136
  def _process_nok_response(
137
137
  self,
@@ -140,21 +140,21 @@ class _WiserRestController(object):
140
140
  data: dict,
141
141
  raise_for_endpoint_error: bool = True,
142
142
  ):
143
- if response.status_code == 401:
143
+ if response.status == 401:
144
144
  raise WiserHubAuthenticationError(
145
145
  f"Error authenticating to Wiser Hub {self._wiser_connection_info.host}. Check your secret key"
146
146
  )
147
- elif response.status_code == 404 and raise_for_endpoint_error:
147
+ elif response.status == 404 and raise_for_endpoint_error:
148
148
  raise WiserHubRESTError(
149
149
  f"Rest endpoint not found on Wiser Hub {self._wiser_connection_info.host} for url {url}"
150
150
  )
151
- elif response.status_code == 408:
151
+ elif response.status == 408:
152
152
  raise WiserHubConnectionError(
153
153
  f"Connection timed out trying to communicate with Wiser Hub {self._wiser_connection_info.host} for url {url}"
154
154
  )
155
155
  elif raise_for_endpoint_error:
156
156
  raise WiserHubRESTError(
157
- f"Unknown error communicating with Wiser Hub {self._wiser_connection_info.host} for url {url} with data {data}. Error code is: {response.status_code}"
157
+ f"Unknown error communicating with Wiser Hub {self._wiser_connection_info.host} for url {url} with data {data}. Error code is: {response.status}"
158
158
  )
159
159
 
160
160
  async def _get_hub_data(
@@ -115,7 +115,7 @@ class WiserAPI(object):
115
115
  ):
116
116
  # Create an instance of the rest controller
117
117
  self._wiser_rest_controller = _WiserRestController(
118
- self._session, wiser_connection_info=self._wiser_api_connection
118
+ wiser_connection_info=self._wiser_api_connection
119
119
  )
120
120
  else:
121
121
  raise WiserHubConnectionError(
@@ -147,8 +147,8 @@ class WiserAPI(object):
147
147
  WISERHUBSCHEDULES
148
148
  )
149
149
  try:
150
- self._status_data = await self._wiser_rest_controller._get_hub_data(
151
- WISERHUBSTATUS
150
+ self._status_data = (
151
+ await self._wiser_rest_controller._get_hub_data(WISERHUBSTATUS)
152
152
  )
153
153
  except WiserHubRESTError:
154
154
  self._status_data = {}
@@ -161,16 +161,22 @@ class WiserAPI(object):
161
161
  )
162
162
 
163
163
  # load extra data
164
- self._wiser_rest_controller._extra_config_file = self._extra_config_file
164
+ self._wiser_rest_controller._extra_config_file = (
165
+ self._extra_config_file
166
+ )
165
167
  await self._wiser_rest_controller._get_extra_config_data()
166
168
 
167
169
  # Only get opentherm data if connected
168
170
  if (
169
- self._domain_data.get("System", {}).get("OpenThermConnectionStatus", "")
171
+ self._domain_data.get("System", {}).get(
172
+ "OpenThermConnectionStatus", ""
173
+ )
170
174
  == "Connected"
171
175
  ):
172
- self._opentherm_data = await self._wiser_rest_controller._get_hub_data(
173
- WISERHUBOPENTHERM, False
176
+ self._opentherm_data = (
177
+ await self._wiser_rest_controller._get_hub_data(
178
+ WISERHUBOPENTHERM, False
179
+ )
174
180
  )
175
181
 
176
182
  if self._domain_data != {} and self._network_data != {}:
@@ -228,7 +234,8 @@ class WiserAPI(object):
228
234
  # Moments
229
235
  if self._domain_data.get("Moment"):
230
236
  self._moments = _WiserMomentCollection(
231
- self._wiser_rest_controller, self._domain_data.get("Moment")
237
+ self._wiser_rest_controller,
238
+ self._domain_data.get("Moment"),
232
239
  )
233
240
 
234
241
  # If gets here with no exceptions then success and return true
@@ -326,7 +333,9 @@ class WiserAPI(object):
326
333
  try:
327
334
  if data:
328
335
  # Write out to file
329
- log_response_to_file(data, filename, False, pathlib.Path(file_path))
336
+ log_response_to_file(
337
+ data, filename, False, pathlib.Path(file_path)
338
+ )
330
339
  return True
331
340
  except Exception as ex:
332
341
  _LOGGER.error(ex)
@@ -1,25 +1,24 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.1
3
+ Version: 1.5.2
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
7
7
  Author-email: msparker@sky.com
8
8
  Classifier: Development Status :: 5 - Production/Stable
9
9
  Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3.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.10
13
+ Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: zeroconf>=0.47.1
17
- Requires-Dist: aiohttp>=3.8.1
18
- Requires-Dist: aiofiles>=0.8.0
19
- Requires-Dist: pyyaml>=6.0
20
- Requires-Dist: httpx>=0.25.0
16
+ Requires-Dist: zeroconf>=0.127.0
17
+ Requires-Dist: aiohttp>=3.9.1
18
+ Requires-Dist: aiofiles>=23.2.1
19
+ Requires-Dist: pyyaml>=6.0.1
21
20
 
22
- # Drayton Wiser Hub API Async v1.5.1
21
+ # Drayton Wiser Hub API Async v1.5.2
23
22
 
24
23
  This repository contains a simple API which queries the Drayton Wiser Heating sysystem used in the UK.
25
24
 
@@ -73,6 +72,10 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
73
72
 
74
73
  ## Changelog
75
74
 
75
+ ### v1.5.2
76
+
77
+ * Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
78
+
76
79
  ### v1.5.1
77
80
 
78
81
  * Fix nuances with httpx
@@ -0,0 +1,4 @@
1
+ zeroconf>=0.127.0
2
+ aiohttp>=3.9.1
3
+ aiofiles>=23.2.1
4
+ pyyaml>=6.0.1
@@ -35,18 +35,17 @@ setuptools.setup(
35
35
  classifiers=[
36
36
  "Development Status :: 5 - Production/Stable",
37
37
  "Intended Audience :: Developers",
38
- "Programming Language :: Python :: 3.10",
38
+ "Programming Language :: Python :: 3.11",
39
39
  "License :: OSI Approved :: MIT License",
40
40
  "Operating System :: OS Independent",
41
41
  ],
42
42
  install_requires=[
43
- "zeroconf>=0.47.1",
44
- "aiohttp>=3.8.1",
45
- "aiofiles>=0.8.0",
46
- "pyyaml>=6.0",
47
- "httpx>=0.25.0",
43
+ "zeroconf>=0.127.0",
44
+ "aiohttp>=3.9.1",
45
+ "aiofiles>=23.2.1",
46
+ "pyyaml>=6.0.1",
48
47
  ],
49
- python_requires=">=3.10",
48
+ python_requires=">=3.11",
50
49
  entry_points={
51
50
  "console_scripts": ["wiser = aioWiserHeatAPI.cli:main"],
52
51
  },
@@ -1,5 +0,0 @@
1
- zeroconf>=0.47.1
2
- aiohttp>=3.8.1
3
- aiofiles>=0.8.0
4
- pyyaml>=6.0
5
- httpx>=0.25.0
File without changes