aioWiserHeatAPI 1.5.1__tar.gz → 1.5.3__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.
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/PKG-INFO +16 -9
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/README.md +9 -1
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/__init__.py +1 -1
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/rest_controller.py +73 -49
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/wiserhub.py +18 -14
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/PKG-INFO +16 -9
- aioWiserHeatAPI-1.5.3/aioWiserHeatAPI.egg-info/requires.txt +4 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/setup.py +6 -7
- aioWiserHeatAPI-1.5.1/aioWiserHeatAPI.egg-info/requires.txt +0 -5
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/LICENSE +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/cli.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/const.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/devices.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/discovery.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/exceptions.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/heating.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/heating_actuator.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/__init__.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/automations.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/battery.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/cloud.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/device.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/equipment.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/firmware.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/gps.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/misc.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/network.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/opentherm.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/signal.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/special_times.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/status.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/temp.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/hot_water.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/light.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/moments.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/pte.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/room.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/roomstat.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/schedule.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/shutter.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/smartplug.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/smartvalve.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/system.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI/ufh.py +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/SOURCES.txt +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
- {aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/setup.cfg +0 -0
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aioWiserHeatAPI
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.3
|
|
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
|
+
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.
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
-
Requires-Dist: zeroconf>=0.
|
|
17
|
-
Requires-Dist: aiohttp>=3.
|
|
18
|
-
Requires-Dist: aiofiles>=
|
|
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.
|
|
21
|
+
# Drayton Wiser Hub API Async v1.5.3
|
|
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,14 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
|
|
|
73
72
|
|
|
74
73
|
## Changelog
|
|
75
74
|
|
|
75
|
+
### v1.5.3
|
|
76
|
+
|
|
77
|
+
* Fixed issue whereby json conversion errors due to control characters in string
|
|
78
|
+
|
|
79
|
+
### v1.5.2
|
|
80
|
+
|
|
81
|
+
* Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
|
|
82
|
+
|
|
76
83
|
### v1.5.1
|
|
77
84
|
|
|
78
85
|
* Fix nuances with httpx
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Drayton Wiser Hub API Async v1.5.
|
|
1
|
+
# Drayton Wiser Hub API Async v1.5.3
|
|
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,14 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
|
|
|
52
52
|
|
|
53
53
|
## Changelog
|
|
54
54
|
|
|
55
|
+
### v1.5.3
|
|
56
|
+
|
|
57
|
+
* Fixed issue whereby json conversion errors due to control characters in string
|
|
58
|
+
|
|
59
|
+
### v1.5.2
|
|
60
|
+
|
|
61
|
+
* Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
|
|
62
|
+
|
|
55
63
|
### v1.5.1
|
|
56
64
|
|
|
57
65
|
* Fix nuances with httpx
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
"""Module to manage rest commands of Wiser hub"""
|
|
1
2
|
import asyncio
|
|
2
3
|
import enum
|
|
3
4
|
import json
|
|
4
5
|
import re
|
|
5
6
|
from dataclasses import dataclass
|
|
6
|
-
from typing import
|
|
7
|
+
from typing import Optional
|
|
7
8
|
|
|
8
9
|
import aiohttp
|
|
9
|
-
import httpx
|
|
10
10
|
|
|
11
11
|
from aioWiserHeatAPI.helpers.extra_config import _WiserExtraConfig
|
|
12
12
|
|
|
@@ -27,6 +27,8 @@ from .exceptions import (
|
|
|
27
27
|
|
|
28
28
|
@dataclass
|
|
29
29
|
class WiserAPIParams:
|
|
30
|
+
"""Class to hold default values"""
|
|
31
|
+
|
|
30
32
|
passive_mode_increment = 0.5
|
|
31
33
|
stored_manual_target_temperature_alt_source = "current"
|
|
32
34
|
|
|
@@ -44,6 +46,8 @@ class _WiserConnectionInfo(object):
|
|
|
44
46
|
|
|
45
47
|
# Enums
|
|
46
48
|
class WiserRestActionEnum(enum.Enum):
|
|
49
|
+
"""Enumeration of http methods"""
|
|
50
|
+
|
|
47
51
|
GET = "get"
|
|
48
52
|
POST = "post"
|
|
49
53
|
PATCH = "patch"
|
|
@@ -57,18 +61,20 @@ class _WiserRestController(object):
|
|
|
57
61
|
|
|
58
62
|
def __init__(
|
|
59
63
|
self,
|
|
60
|
-
session: Optional[aiohttp.ClientSession] = None,
|
|
61
64
|
timeout: Optional[float] = REST_TIMEOUT,
|
|
62
65
|
wiser_connection_info: Optional[_WiserConnectionInfo] = None,
|
|
63
66
|
):
|
|
64
67
|
self._wiser_connection_info = wiser_connection_info
|
|
65
68
|
self._api_parameters = WiserAPIParams()
|
|
66
|
-
|
|
67
|
-
self._timeout = timeout # aiohttp.ClientTimeout(total=timeout)
|
|
69
|
+
self._timeout = aiohttp.ClientTimeout(total=timeout)
|
|
68
70
|
self._hub_name = None
|
|
69
71
|
self._extra_config_file = None
|
|
70
72
|
self._extra_config: _WiserExtraConfig = None
|
|
71
73
|
|
|
74
|
+
def remove_control_characters(self, data: str):
|
|
75
|
+
"""Remove control charactwers from string."""
|
|
76
|
+
return re.sub(r"[\x00-\x1f]", "", data)
|
|
77
|
+
|
|
72
78
|
async def _do_hub_action(
|
|
73
79
|
self,
|
|
74
80
|
action: WiserRestActionEnum,
|
|
@@ -88,12 +94,11 @@ class _WiserRestController(object):
|
|
|
88
94
|
self._wiser_connection_info.port,
|
|
89
95
|
)
|
|
90
96
|
|
|
91
|
-
kwargs = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
+
kwargs = {}
|
|
98
|
+
|
|
99
|
+
kwargs["headers"] = {
|
|
100
|
+
"SECRET": self._wiser_connection_info.secret,
|
|
101
|
+
"Content-Type": "application/json;charset=UTF-8",
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
if data is not None:
|
|
@@ -103,34 +108,47 @@ class _WiserRestController(object):
|
|
|
103
108
|
kwargs["timeout"] = self._timeout
|
|
104
109
|
|
|
105
110
|
try:
|
|
106
|
-
async with
|
|
107
|
-
|
|
111
|
+
async with aiohttp.ClientSession(
|
|
112
|
+
version=aiohttp.HttpVersion10,
|
|
113
|
+
) as session:
|
|
114
|
+
async with getattr(session, action.value)(
|
|
108
115
|
url,
|
|
109
116
|
**kwargs,
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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"
|
|
117
|
+
) as response:
|
|
118
|
+
if not response.ok:
|
|
119
|
+
self._process_nok_response(
|
|
120
|
+
response, url, data, raise_for_endpoint_error
|
|
121
121
|
)
|
|
122
|
-
return json.loads(response)
|
|
123
122
|
else:
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
content = await response.read()
|
|
124
|
+
if len(content) > 0:
|
|
125
|
+
response = content.decode("utf-8", "ignore")
|
|
126
|
+
return json.loads(
|
|
127
|
+
self.remove_control_characters(response),
|
|
128
|
+
)
|
|
129
|
+
else:
|
|
130
|
+
return {}
|
|
131
|
+
return {}
|
|
126
132
|
|
|
127
|
-
except
|
|
133
|
+
except asyncio.TimeoutError as ex:
|
|
128
134
|
raise WiserHubConnectionError(
|
|
129
|
-
f"Connection timeout trying to communicate with Wiser Hub
|
|
135
|
+
f"Connection timeout trying to communicate with Wiser Hub "
|
|
136
|
+
f"{self._wiser_connection_info.host} for url {url}"
|
|
130
137
|
) from ex
|
|
131
|
-
except
|
|
138
|
+
except ConnectionResetError as ex:
|
|
132
139
|
raise WiserHubConnectionError(
|
|
133
|
-
f"Connection
|
|
140
|
+
f"Connection was reset by the hub during communication "
|
|
141
|
+
f"{self._wiser_connection_info.host} for url {url}. Error is {ex}"
|
|
142
|
+
) from ex
|
|
143
|
+
except aiohttp.ClientResponseError as ex:
|
|
144
|
+
raise WiserHubConnectionError(
|
|
145
|
+
f"Response error trying to communicate with Wiser Hub "
|
|
146
|
+
f"{self._wiser_connection_info.host} for url {url}. Error is {ex}"
|
|
147
|
+
) from ex
|
|
148
|
+
except aiohttp.ClientConnectorError as ex:
|
|
149
|
+
raise WiserHubConnectionError(
|
|
150
|
+
f"Connection error trying to communicate with Wiser Hub "
|
|
151
|
+
f"{self._wiser_connection_info.host} for url {url}. Error is {ex}"
|
|
134
152
|
) from ex
|
|
135
153
|
|
|
136
154
|
def _process_nok_response(
|
|
@@ -140,21 +158,26 @@ class _WiserRestController(object):
|
|
|
140
158
|
data: dict,
|
|
141
159
|
raise_for_endpoint_error: bool = True,
|
|
142
160
|
):
|
|
143
|
-
if response.
|
|
161
|
+
if response.status == 401:
|
|
144
162
|
raise WiserHubAuthenticationError(
|
|
145
|
-
f"Error authenticating to Wiser Hub
|
|
163
|
+
f"Error authenticating to Wiser Hub "
|
|
164
|
+
f"{self._wiser_connection_info.host}. Check your secret key"
|
|
146
165
|
)
|
|
147
|
-
elif response.
|
|
166
|
+
elif response.status == 404 and raise_for_endpoint_error:
|
|
148
167
|
raise WiserHubRESTError(
|
|
149
|
-
f"Rest endpoint not found on Wiser Hub
|
|
168
|
+
f"Rest endpoint not found on Wiser Hub "
|
|
169
|
+
f"{self._wiser_connection_info.host} for url {url}"
|
|
150
170
|
)
|
|
151
|
-
elif response.
|
|
171
|
+
elif response.status == 408:
|
|
152
172
|
raise WiserHubConnectionError(
|
|
153
|
-
f"Connection timed out trying to communicate with Wiser Hub
|
|
173
|
+
f"Connection timed out trying to communicate with Wiser Hub "
|
|
174
|
+
f"{self._wiser_connection_info.host} for url {url}"
|
|
154
175
|
)
|
|
155
176
|
elif raise_for_endpoint_error:
|
|
156
177
|
raise WiserHubRESTError(
|
|
157
|
-
f"Unknown error communicating with Wiser Hub
|
|
178
|
+
f"Unknown error communicating with Wiser Hub "
|
|
179
|
+
f"{self._wiser_connection_info.host} for url {url} with data {data}. "
|
|
180
|
+
f"Error code is: {response.status}"
|
|
158
181
|
)
|
|
159
182
|
|
|
160
183
|
async def _get_hub_data(
|
|
@@ -176,9 +199,10 @@ class _WiserRestController(object):
|
|
|
176
199
|
self._extra_config_file, self._hub_name.lower()
|
|
177
200
|
)
|
|
178
201
|
await self._extra_config.async_load_config()
|
|
179
|
-
except WiserExtraConfigError
|
|
202
|
+
except WiserExtraConfigError:
|
|
180
203
|
_LOGGER.error(
|
|
181
|
-
"Your config file is corrupted and needs to be fixed
|
|
204
|
+
"Your config file is corrupted and needs to be fixed "
|
|
205
|
+
"to maintain all the functionality of this integration."
|
|
182
206
|
)
|
|
183
207
|
self._extra_config = None
|
|
184
208
|
|
|
@@ -196,9 +220,7 @@ class _WiserRestController(object):
|
|
|
196
220
|
"""
|
|
197
221
|
url = WISERHUBDOMAIN + url
|
|
198
222
|
_LOGGER.debug(
|
|
199
|
-
"Sending command to url:
|
|
200
|
-
url, command_data
|
|
201
|
-
)
|
|
223
|
+
"Sending command to url: %s with parameters %s", url, command_data
|
|
202
224
|
)
|
|
203
225
|
|
|
204
226
|
return await self._do_hub_action(method, url, command_data)
|
|
@@ -214,17 +236,19 @@ class _WiserRestController(object):
|
|
|
214
236
|
"""
|
|
215
237
|
url = WISERHUBSCHEDULES + url
|
|
216
238
|
_LOGGER.debug(
|
|
217
|
-
"Actioning schedule to url:
|
|
218
|
-
|
|
219
|
-
|
|
239
|
+
"Actioning schedule to url: %s with action %s and data %s",
|
|
240
|
+
url,
|
|
241
|
+
action.value,
|
|
242
|
+
schedule_data,
|
|
220
243
|
)
|
|
244
|
+
|
|
221
245
|
return await self._do_hub_action(action, url, schedule_data)
|
|
222
246
|
|
|
223
247
|
async def _send_schedule_command(
|
|
224
248
|
self,
|
|
225
249
|
action: str,
|
|
226
250
|
schedule_data: dict,
|
|
227
|
-
|
|
251
|
+
schedule_id: int = 0,
|
|
228
252
|
schedule_type: str = None,
|
|
229
253
|
) -> bool:
|
|
230
254
|
"""
|
|
@@ -236,7 +260,7 @@ class _WiserRestController(object):
|
|
|
236
260
|
if action == "UPDATE":
|
|
237
261
|
result = await self._do_schedule_action(
|
|
238
262
|
WiserRestActionEnum.PATCH,
|
|
239
|
-
"{}/{}"
|
|
263
|
+
f"{schedule_type}/{schedule_id}",
|
|
240
264
|
schedule_data,
|
|
241
265
|
)
|
|
242
266
|
|
|
@@ -257,7 +281,7 @@ class _WiserRestController(object):
|
|
|
257
281
|
elif action == "DELETE":
|
|
258
282
|
result = await self._do_schedule_action(
|
|
259
283
|
WiserRestActionEnum.DELETE,
|
|
260
|
-
"{}/{}"
|
|
284
|
+
f"{schedule_type}/{schedule_id}",
|
|
261
285
|
schedule_data,
|
|
262
286
|
)
|
|
263
287
|
return result
|
|
@@ -66,13 +66,11 @@ class WiserAPI(object):
|
|
|
66
66
|
host: str,
|
|
67
67
|
secret: str,
|
|
68
68
|
port: Optional[int] = 80,
|
|
69
|
-
session: Optional[aiohttp.ClientSession] = None,
|
|
70
69
|
units: Optional[WiserUnitsEnum] = WiserUnitsEnum.metric,
|
|
71
70
|
extra_config_file: Optional[str] = None,
|
|
72
71
|
enable_automations: Optional[bool] = True,
|
|
73
72
|
):
|
|
74
73
|
# Connection variables
|
|
75
|
-
self._session = session
|
|
76
74
|
self._wiser_api_connection = _WiserConnectionInfo()
|
|
77
75
|
self._wiser_rest_controller = None
|
|
78
76
|
|
|
@@ -115,7 +113,7 @@ class WiserAPI(object):
|
|
|
115
113
|
):
|
|
116
114
|
# Create an instance of the rest controller
|
|
117
115
|
self._wiser_rest_controller = _WiserRestController(
|
|
118
|
-
|
|
116
|
+
wiser_connection_info=self._wiser_api_connection
|
|
119
117
|
)
|
|
120
118
|
else:
|
|
121
119
|
raise WiserHubConnectionError(
|
|
@@ -147,8 +145,8 @@ class WiserAPI(object):
|
|
|
147
145
|
WISERHUBSCHEDULES
|
|
148
146
|
)
|
|
149
147
|
try:
|
|
150
|
-
self._status_data =
|
|
151
|
-
WISERHUBSTATUS
|
|
148
|
+
self._status_data = (
|
|
149
|
+
await self._wiser_rest_controller._get_hub_data(WISERHUBSTATUS)
|
|
152
150
|
)
|
|
153
151
|
except WiserHubRESTError:
|
|
154
152
|
self._status_data = {}
|
|
@@ -161,16 +159,22 @@ class WiserAPI(object):
|
|
|
161
159
|
)
|
|
162
160
|
|
|
163
161
|
# load extra data
|
|
164
|
-
self._wiser_rest_controller._extra_config_file =
|
|
162
|
+
self._wiser_rest_controller._extra_config_file = (
|
|
163
|
+
self._extra_config_file
|
|
164
|
+
)
|
|
165
165
|
await self._wiser_rest_controller._get_extra_config_data()
|
|
166
166
|
|
|
167
167
|
# Only get opentherm data if connected
|
|
168
168
|
if (
|
|
169
|
-
self._domain_data.get("System", {}).get(
|
|
169
|
+
self._domain_data.get("System", {}).get(
|
|
170
|
+
"OpenThermConnectionStatus", ""
|
|
171
|
+
)
|
|
170
172
|
== "Connected"
|
|
171
173
|
):
|
|
172
|
-
self._opentherm_data =
|
|
173
|
-
|
|
174
|
+
self._opentherm_data = (
|
|
175
|
+
await self._wiser_rest_controller._get_hub_data(
|
|
176
|
+
WISERHUBOPENTHERM, False
|
|
177
|
+
)
|
|
174
178
|
)
|
|
175
179
|
|
|
176
180
|
if self._domain_data != {} and self._network_data != {}:
|
|
@@ -228,7 +232,8 @@ class WiserAPI(object):
|
|
|
228
232
|
# Moments
|
|
229
233
|
if self._domain_data.get("Moment"):
|
|
230
234
|
self._moments = _WiserMomentCollection(
|
|
231
|
-
self._wiser_rest_controller,
|
|
235
|
+
self._wiser_rest_controller,
|
|
236
|
+
self._domain_data.get("Moment"),
|
|
232
237
|
)
|
|
233
238
|
|
|
234
239
|
# If gets here with no exceptions then success and return true
|
|
@@ -236,9 +241,6 @@ class WiserAPI(object):
|
|
|
236
241
|
|
|
237
242
|
return False
|
|
238
243
|
|
|
239
|
-
async def close_session(self):
|
|
240
|
-
await self._wiser_rest_controller._session.close()
|
|
241
|
-
|
|
242
244
|
# API properties
|
|
243
245
|
@property
|
|
244
246
|
def api_parameters(self):
|
|
@@ -326,7 +328,9 @@ class WiserAPI(object):
|
|
|
326
328
|
try:
|
|
327
329
|
if data:
|
|
328
330
|
# Write out to file
|
|
329
|
-
log_response_to_file(
|
|
331
|
+
log_response_to_file(
|
|
332
|
+
data, filename, False, pathlib.Path(file_path)
|
|
333
|
+
)
|
|
330
334
|
return True
|
|
331
335
|
except Exception as ex:
|
|
332
336
|
_LOGGER.error(ex)
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aioWiserHeatAPI
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.3
|
|
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
|
+
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.
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
14
|
Description-Content-Type: text/markdown
|
|
15
15
|
License-File: LICENSE
|
|
16
|
-
Requires-Dist: zeroconf>=0.
|
|
17
|
-
Requires-Dist: aiohttp>=3.
|
|
18
|
-
Requires-Dist: aiofiles>=
|
|
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.
|
|
21
|
+
# Drayton Wiser Hub API Async v1.5.3
|
|
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,14 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
|
|
|
73
72
|
|
|
74
73
|
## Changelog
|
|
75
74
|
|
|
75
|
+
### v1.5.3
|
|
76
|
+
|
|
77
|
+
* Fixed issue whereby json conversion errors due to control characters in string
|
|
78
|
+
|
|
79
|
+
### v1.5.2
|
|
80
|
+
|
|
81
|
+
* Revert to aiohttp and fix errors with v3.9.x that caused move to httpx
|
|
82
|
+
|
|
76
83
|
### v1.5.1
|
|
77
84
|
|
|
78
85
|
* Fix nuances with httpx
|
|
@@ -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.
|
|
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.
|
|
44
|
-
"aiohttp>=3.
|
|
45
|
-
"aiofiles>=
|
|
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.
|
|
48
|
+
python_requires=">=3.11",
|
|
50
49
|
entry_points={
|
|
51
50
|
"console_scripts": ["wiser = aioWiserHeatAPI.cli:main"],
|
|
52
51
|
},
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{aioWiserHeatAPI-1.5.1 → aioWiserHeatAPI-1.5.3}/aioWiserHeatAPI.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|