aioWiserHeatAPI 1.5.12__tar.gz → 1.5.14__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.12 → aiowiserheatapi-1.5.14}/PKG-INFO +14 -2
  2. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/README.md +13 -1
  3. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/__init__.py +1 -1
  4. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/const.py +2 -1
  5. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/heating_actuator.py +3 -47
  6. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/equipment.py +20 -1
  7. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/pte.py +21 -40
  8. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/rest_controller.py +32 -11
  9. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/room.py +4 -10
  10. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/smartplug.py +2 -2
  11. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/system.py +11 -0
  12. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/wiserhub.py +2 -0
  13. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/PKG-INFO +14 -2
  14. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/LICENSE +0 -0
  15. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/cli.py +0 -0
  16. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/devices.py +0 -0
  17. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/discovery.py +0 -0
  18. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/exceptions.py +0 -0
  19. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/heating.py +0 -0
  20. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/__init__.py +0 -0
  21. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/automations.py +0 -0
  22. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/battery.py +0 -0
  23. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
  24. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/cloud.py +0 -0
  25. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/device.py +0 -0
  26. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
  27. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/firmware.py +0 -0
  28. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/gps.py +0 -0
  29. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/misc.py +0 -0
  30. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/network.py +0 -0
  31. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/opentherm.py +0 -0
  32. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/signal.py +0 -0
  33. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/special_times.py +0 -0
  34. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/status.py +0 -0
  35. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/temp.py +0 -0
  36. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
  37. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/hot_water.py +0 -0
  38. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/light.py +0 -0
  39. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/moments.py +0 -0
  40. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/roomstat.py +0 -0
  41. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/schedule.py +0 -0
  42. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/shutter.py +0 -0
  43. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/smartvalve.py +0 -0
  44. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/smokealarm.py +0 -0
  45. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI/ufh.py +0 -0
  46. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/SOURCES.txt +0 -0
  47. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
  48. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
  49. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/requires.txt +0 -0
  50. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
  51. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/setup.cfg +0 -0
  52. {aioWiserHeatAPI-1.5.12 → aiowiserheatapi-1.5.14}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.12
3
+ Version: 1.5.14
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
@@ -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.12
21
+ # Drayton Wiser Hub API Async v1.5.14
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,18 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
72
72
 
73
73
  ## Changelog
74
74
 
75
+ ### v1.5.14
76
+
77
+ * Fix presets not using defined boost temp
78
+ * Set return value of energy sensors to None if not provided by hub
79
+ * Updated headers for hub query
80
+
81
+ ### v1.5.13
82
+
83
+ * Updates to support v2 hub functions - @LGO44
84
+ * Add connection timeout to new retry function
85
+ * Increase http timeout from 10s to 20s
86
+
75
87
  ### v1.5.12
76
88
 
77
89
  * Improve performance of hub read and retries
@@ -1,4 +1,4 @@
1
- # Drayton Wiser Hub API Async v1.5.12
1
+ # Drayton Wiser Hub API Async v1.5.14
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,18 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
52
52
 
53
53
  ## Changelog
54
54
 
55
+ ### v1.5.14
56
+
57
+ * Fix presets not using defined boost temp
58
+ * Set return value of energy sensors to None if not provided by hub
59
+ * Updated headers for hub query
60
+
61
+ ### v1.5.13
62
+
63
+ * Updates to support v2 hub functions - @LGO44
64
+ * Add connection timeout to new retry function
65
+ * Increase http timeout from 10s to 20s
66
+
55
67
  ### v1.5.12
56
68
 
57
69
  * Improve performance of hub read and retries
@@ -3,6 +3,6 @@ import logging
3
3
  name = "aioWiserHeatAPI"
4
4
  __all__ = ["wiserAPI", "wiserDiscovery"]
5
5
 
6
- __VERSION__ = "1.5.12"
6
+ __VERSION__ = "1.5.14"
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
@@ -33,7 +33,7 @@ TRV_BATTERY_LEVEL_MAPPING = {
33
33
  REST_RETRY_BACKOFF = [0.1, 0.5, 1, 3, 5]
34
34
  REST_BACKOFF_FACTOR = 1
35
35
  REST_RETRIES = 3
36
- REST_TIMEOUT = 10
36
+ REST_TIMEOUT = 20
37
37
 
38
38
  # Text Values
39
39
  TEXT_AUTO = "Auto"
@@ -59,6 +59,7 @@ TEXT_UNKNOWN = "Unknown"
59
59
  TEXT_WEEKDAYS = "Weekdays"
60
60
  TEXT_WEEKENDS = "Weekends"
61
61
  TEXT_ALL = "All"
62
+ TEXT_UNABLE = "Unable"
62
63
 
63
64
  # Day Value Lists
64
65
  WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
@@ -4,6 +4,7 @@ from .const import (
4
4
  WISERHEATINGACTUATOR,
5
5
  WiserTempLimitsEnum,
6
6
  )
7
+ from .helpers.capabilities import _WiserClimateCapabilities
7
8
  from .helpers.device import _WiserDevice
8
9
  from .helpers.equipment import _WiserEquipment
9
10
  from .helpers.temp import _WiserTemperatureFunctions as tf
@@ -136,7 +137,7 @@ class _WiserHeatingActuator(_WiserDevice):
136
137
  @property
137
138
  def delivered_power(self) -> int:
138
139
  """Get the amount of power delivered over time"""
139
- return self._device_type_data.get("CurrentSummationDelivered", 0)
140
+ return self._device_type_data.get("CurrentSummationDelivered", None)
140
141
 
141
142
  @property
142
143
  def equipment_id(self) -> int:
@@ -165,58 +166,13 @@ class _WiserHeatingActuator(_WiserDevice):
165
166
  @property
166
167
  def instantaneous_power(self) -> int:
167
168
  """Get the amount of current passing through the device now"""
168
- return self._device_type_data.get("InstantaneousDemand", 0)
169
+ return self._device_type_data.get("InstantaneousDemand", None)
169
170
 
170
171
  @property
171
172
  def output_type(self) -> str:
172
173
  """Get output type"""
173
174
  return self._device_type_data.get("OutputType", TEXT_UNKNOWN)
174
175
 
175
- # added by LGO
176
- @property
177
- def active_power(self) -> int:
178
- """Get active power"""
179
- return self._device_type_data.get("ActivePower", 0)
180
-
181
- @property
182
- def total_active_power(self) -> int:
183
- """Get total active power"""
184
- return self._device_type_data.get("TotalActivePower", 0)
185
-
186
- @property
187
- def operation_status(self) -> str:
188
- """Get Operation status"""
189
- return self._device_type_data.get("OperationStatus", TEXT_UNKNOWN)
190
-
191
- @property
192
- def fault_status(self) -> str:
193
- """Get Fault status"""
194
- return self._device_type_data.get("FaultStatus", TEXT_UNKNOWN)
195
-
196
- # equipment for energy management
197
- @property
198
- def equipment_type(self) -> str:
199
- """Get Equipment type"""
200
- return self._device_type_data.get("EquipmentType", TEXT_UNKNOWN)
201
-
202
- @property
203
- def equipment_family(self) -> str:
204
- """Get Equipment family"""
205
- return self._device_type_data.get("EquipmentFamily", TEXT_UNKNOWN)
206
-
207
- @property
208
- def installation_type(self) -> str:
209
- """Get Installation type"""
210
- return self._device_type_data.get("InstallationType", TEXT_UNKNOWN)
211
-
212
- @property
213
- def number_of_phases(self) -> int:
214
- """Get Installation type"""
215
- return self._device_type_data.get("NumberOfPhases", 0)
216
-
217
-
218
- # End added by LGO
219
-
220
176
 
221
177
  class _WiserHeatingActuatorCollection(object):
222
178
  """Class holding all wiser heating actuators"""
@@ -2,7 +2,6 @@
2
2
  Handles equipment data
3
3
  """
4
4
 
5
-
6
5
  from ..const import TEXT_UNKNOWN
7
6
 
8
7
 
@@ -97,6 +96,26 @@ class _WiserEquipment:
97
96
  """Get equipment family"""
98
97
  return self._data.get("EquipmentFamily", TEXT_UNKNOWN)
99
98
 
99
+ @property
100
+ def equipment_name(self) -> str:
101
+ """Get equipment name"""
102
+ return self._data.get("EquipmentName", TEXT_UNKNOWN)
103
+
104
+ @property
105
+ def product_type(self) -> str:
106
+ """Get equipment name"""
107
+ return self._data.get("ProductType", TEXT_UNKNOWN)
108
+
109
+ @property
110
+ def functional_control_mode(self) -> str:
111
+ """Get functional control mode"""
112
+ return self._data.get("FunctionalControlMode", TEXT_UNKNOWN)
113
+
114
+ @property
115
+ def pcm_mode(self) -> bool:
116
+ """Get Pcm Mode"""
117
+ return self._data.get("PcmMode", False)
118
+
100
119
  @property
101
120
  def direction(self) -> str:
102
121
  """Get flow direction"""
@@ -2,7 +2,7 @@
2
2
  Handles power tag energy devices
3
3
  """
4
4
 
5
- from .const import TEXT_UNKNOWN
5
+ from .const import TEXT_UNABLE, TEXT_UNKNOWN
6
6
  from .helpers.device import _WiserDevice
7
7
  from .helpers.equipment import _WiserEquipment
8
8
 
@@ -11,19 +11,14 @@ class _WiserPowerTagEnergy(_WiserDevice):
11
11
  """Class representing a Wiser Power Tag Energy device"""
12
12
 
13
13
  @property
14
- def direction(self) -> str:
15
- """Get flow direction"""
16
- return self._device_type_data.get("Direction", TEXT_UNKNOWN)
17
-
18
- @property
19
- def equipment_id(self) -> int:
20
- """Get equipment id"""
21
- return self._device_type_data.get("EquipmentId", 0)
14
+ def delivered_power(self) -> int:
15
+ """Get current power of device"""
16
+ return self.equipment.power.current_summation_delivered
22
17
 
23
18
  @property
24
19
  def energy_export(self) -> str:
25
20
  """Get energy export status"""
26
- return self._device_type_data.get("EnergyExport", TEXT_UNKNOWN)
21
+ return self._device_type_data.get("EnergyExport", TEXT_UNABLE)
27
22
 
28
23
  @property
29
24
  def equipment(self) -> str:
@@ -34,11 +29,6 @@ class _WiserPowerTagEnergy(_WiserDevice):
34
29
  else None
35
30
  )
36
31
 
37
- @property
38
- def fault_status(self) -> str:
39
- """Get fault status"""
40
- return self._device_type_data.get("FaultStatus", TEXT_UNKNOWN)
41
-
42
32
  @property
43
33
  def grid_limit(self) -> int:
44
34
  """Get grid limit"""
@@ -49,35 +39,15 @@ class _WiserPowerTagEnergy(_WiserDevice):
49
39
  """Get grid limit uom"""
50
40
  return self._device_type_data.get("GridLimitUom", TEXT_UNKNOWN)
51
41
 
52
- @property
53
- def installation_type(self) -> str:
54
- """Get installation type"""
55
- return self._device_type_data.get("InstallationType", TEXT_UNKNOWN)
56
-
57
- @property
58
- def number_of_phases(self) -> int:
59
- """Get number of phases"""
60
- return self._device_type_data.get("NumberOfPhases", 0)
61
-
62
- @property
63
- def operating_status(self) -> str:
64
- """Get operating status"""
65
- return self._device_type_data.get("OperatingStatus", TEXT_UNKNOWN)
66
-
67
- @property
68
- def raw_total_active_power(self) -> int:
69
- """Get raw total active power of device"""
70
- return self._device_type_data.get("RawTotalActivePower", 0)
71
-
72
42
  @property
73
43
  def instantaneous_power(self) -> int:
74
44
  """Get current power of device"""
75
45
  return self.equipment.power.total_active_power
76
46
 
77
47
  @property
78
- def delivered_power(self) -> int:
79
- """Get current power of device"""
80
- return self.equipment.power.current_summation_delivered
48
+ def raw_total_active_power(self) -> int:
49
+ """Get raw total active power of device"""
50
+ return self._device_type_data.get("RawTotalActivePower", None)
81
51
 
82
52
  @property
83
53
  def received_power(self) -> int:
@@ -89,6 +59,11 @@ class _WiserPowerTagEnergy(_WiserDevice):
89
59
  """Get rfid of device"""
90
60
  return self._data.get("RfId", 0)
91
61
 
62
+ @property
63
+ def self_consumption(self) -> bool:
64
+ """Get self consumption"""
65
+ return self._device_type_data.get("SelfConsumption", False)
66
+
92
67
 
93
68
  class _WiserPowerTagEnergyCollection:
94
69
  """Class representing collection of Power Tag Energy devices"""
@@ -113,7 +88,11 @@ class _WiserPowerTagEnergyCollection:
113
88
  return: _WiserPowerTagEnergy object
114
89
  """
115
90
  try:
116
- return [power_tag for power_tag in self.all if power_tag.id == device_id][0]
91
+ return [
92
+ power_tag
93
+ for power_tag in self.all
94
+ if power_tag.id == device_id
95
+ ][0]
117
96
  except IndexError:
118
97
  return None
119
98
 
@@ -125,7 +104,9 @@ class _WiserPowerTagEnergyCollection:
125
104
  """
126
105
  try:
127
106
  return [
128
- power_tag for power_tag in self.all if power_tag.id == equipment_id
107
+ power_tag
108
+ for power_tag in self.all
109
+ if power_tag.id == equipment_id
129
110
  ][0]
130
111
  except IndexError:
131
112
  return None
@@ -12,6 +12,7 @@ import aiohttp
12
12
 
13
13
  from . import _LOGGER
14
14
  from .const import (
15
+ DEFAULT_BOOST_DELTA,
15
16
  REST_RETRY_BACKOFF,
16
17
  REST_TIMEOUT,
17
18
  WISERHUBDOMAIN,
@@ -34,6 +35,7 @@ class WiserAPIParams:
34
35
 
35
36
  passive_mode_increment = 0.5
36
37
  stored_manual_target_temperature_alt_source = "current"
38
+ boost_temp_delta = DEFAULT_BOOST_DELTA
37
39
 
38
40
 
39
41
  # Connection info class
@@ -74,6 +76,8 @@ class _WiserRestController(object):
74
76
  self._extra_config_file = None
75
77
  self._extra_config: _WiserExtraConfig = None
76
78
 
79
+ self._last_exception = None
80
+
77
81
  def remove_control_characters(self, data: str):
78
82
  """Remove control charactwers from string."""
79
83
  return re.sub(r"[\x00-\x1f]", "", data)
@@ -86,19 +90,33 @@ class _WiserRestController(object):
86
90
  raise_for_endpoint_error: bool = True,
87
91
  ):
88
92
  """Function to retry on response errors due to inconsistant isues reading from the hub."""
89
- http_version = aiohttp.HttpVersion10
93
+ http_version = aiohttp.HttpVersion11
94
+ self._last_exception = None
90
95
 
91
96
  for i in range(0, 5):
92
97
  if i > 0:
93
98
  await asyncio.sleep(REST_RETRY_BACKOFF[i])
94
99
  try:
100
+ start_time = datetime.now()
101
+ _LOGGER.debug(
102
+ "URL: %s, Attempt: %i, Http: %s",
103
+ url.format(
104
+ self._wiser_connection_info.host,
105
+ self._wiser_connection_info.port,
106
+ ),
107
+ i + 1,
108
+ http_version,
109
+ )
95
110
  response = await self._execute_request(
96
111
  action,
97
112
  url,
98
113
  data,
99
114
  raise_for_endpoint_error,
100
115
  http_version,
101
- i + 1,
116
+ )
117
+ _LOGGER.debug(
118
+ "Request successful and took %ss",
119
+ (datetime.now() - start_time).total_seconds(),
102
120
  )
103
121
  return response
104
122
  except WiserHubRESTError as ex:
@@ -106,18 +124,23 @@ class _WiserRestController(object):
106
124
  _LOGGER.debug(
107
125
  "%s. Retrying in %.1fs", ex, REST_RETRY_BACKOFF[i]
108
126
  )
127
+ self._last_exception = ex
109
128
  http_version = aiohttp.HttpVersion11
110
129
  except WiserHubResponseError as ex:
111
130
  # If response error try http1.0
112
131
  _LOGGER.debug(
113
132
  "%s. Retrying in %.1fs", ex, REST_RETRY_BACKOFF[i]
114
133
  )
134
+ self._last_exception = ex
115
135
  http_version = aiohttp.HttpVersion10
136
+ except WiserHubConnectionError as ex:
137
+ # Connection timed out or failed. Try it again
138
+ _LOGGER.debug(
139
+ "%s. Retrying in %.1fs", ex, REST_RETRY_BACKOFF[i]
140
+ )
141
+ self._last_exception = ex
116
142
 
117
- raise WiserHubConnectionError(
118
- f"Unable to get a valid response from the Wiser hub. "
119
- f"{self._wiser_connection_info.host} for url {url}"
120
- )
143
+ raise WiserHubConnectionError(self._last_exception)
121
144
 
122
145
  async def _execute_request( # noqa
123
146
  self,
@@ -126,7 +149,6 @@ class _WiserRestController(object):
126
149
  data: dict = None,
127
150
  raise_for_endpoint_error: bool = True,
128
151
  http_version=aiohttp.HttpVersion11,
129
- attempt: int = 1,
130
152
  ):
131
153
  """
132
154
  Send request to hub and raise errors if fails
@@ -143,6 +165,9 @@ class _WiserRestController(object):
143
165
  kwargs = {}
144
166
  kwargs["headers"] = {
145
167
  "SECRET": self._wiser_connection_info.secret,
168
+ "Accept-Encoding": "gzip, deflate, br",
169
+ "Accept": "*/*",
170
+ "User-Agent": "HomeAssistant",
146
171
  }
147
172
 
148
173
  # if data is not None:
@@ -157,16 +182,12 @@ class _WiserRestController(object):
157
182
  kwargs["timeout"] = self._timeout
158
183
 
159
184
  try:
160
- _LOGGER.debug(
161
- "URL: %s, Attempt: %i, Http: %s", url, attempt, http_version
162
- )
163
185
  async with aiohttp.ClientSession(
164
186
  version=http_version,
165
187
  ) as session:
166
188
  async with session.request(
167
189
  action.value, url, **kwargs
168
190
  ) as response:
169
- # await asyncio.sleep(1)
170
191
  if not response.ok:
171
192
  self._process_nok_response(
172
193
  response, url, data, raise_for_endpoint_error
@@ -68,9 +68,6 @@ class _WiserRoom(object):
68
68
  "max": 18,
69
69
  }
70
70
 
71
- self._boost_temperature_delta = DEFAULT_BOOST_DELTA
72
- # self.stored_manual_target_temperature_alt_source = "current"
73
-
74
71
  # Add device id to schedule
75
72
  if self._schedule:
76
73
  self.schedule._assignments.append(
@@ -237,10 +234,7 @@ class _WiserRoom(object):
237
234
 
238
235
  @property
239
236
  def boost_temperature_delta(self) -> float:
240
- return self._boost_temperature_delta
241
-
242
- def set_boost_temperature_delta(self, temperature_delta: float):
243
- self._boost_temperature_delta = temperature_delta
237
+ return self._wiser_rest_controller._api_parameters.boost_temp_delta
244
238
 
245
239
  @property
246
240
  def capabilities(self) -> _WiserClimateCapabilities:
@@ -456,7 +450,7 @@ class _WiserRoom(object):
456
450
 
457
451
  async def set_preset(self, preset: WiserPresetOptionsEnum | str):
458
452
  """Set the preset mode"""
459
- if type(preset) == WiserPresetOptionsEnum:
453
+ if isinstance(preset, WiserPresetOptionsEnum):
460
454
  preset = preset.value
461
455
 
462
456
  # Is it valid preset option?
@@ -469,9 +463,9 @@ class _WiserRoom(object):
469
463
  # Lookup boost duration
470
464
  duration = WISER_BOOST_DURATION[preset]
471
465
  _LOGGER.debug(
472
- f"Boosting by {self._boost_temperature_delta}C for {duration} mins"
466
+ f"Boosting by {self.boost_temperature_delta}C for {duration} mins"
473
467
  )
474
- await self.boost(self._boost_temperature_delta, duration)
468
+ await self.boost(self.boost_temperature_delta, duration)
475
469
  else:
476
470
  raise ValueError(
477
471
  f"{preset} is not a valid preset. Valid presets are {self.available_presets}"
@@ -17,7 +17,7 @@ class _WiserSmartPlug(_WiserElectricalDevice):
17
17
  @property
18
18
  def delivered_power(self) -> int:
19
19
  """Get the amount of current throught the plug over time"""
20
- return self._device_type_data.get("CurrentSummationDelivered", -1)
20
+ return self._device_type_data.get("CurrentSummationDelivered", None)
21
21
 
22
22
  @property
23
23
  def equipment_id(self) -> int:
@@ -36,7 +36,7 @@ class _WiserSmartPlug(_WiserElectricalDevice):
36
36
  @property
37
37
  def instantaneous_power(self) -> int:
38
38
  """Get the amount of current throught the plug now"""
39
- return self._device_type_data.get("InstantaneousDemand", -1)
39
+ return self._device_type_data.get("InstantaneousDemand", None)
40
40
 
41
41
  @property
42
42
  def manual_state(self) -> str:
@@ -403,6 +403,17 @@ class _WiserSystem(object):
403
403
  self._summer_discomfort_prevention = enabled
404
404
  return True
405
405
 
406
+ @property
407
+ def type_comm(self) -> str:
408
+ """Get type of zigbee device """
409
+ return self._device_data.get("Type", TEXT_UNKNOWN)
410
+
411
+ @property
412
+ def uuid(self) -> str:
413
+ """Get UUID zigbee"""
414
+ return self._device_data.get("UUID", TEXT_UNKNOWN)
415
+
416
+
406
417
  # End Added LGO
407
418
 
408
419
  @property
@@ -166,6 +166,7 @@ class WiserAPI:
166
166
  WiserHubConnectionError,
167
167
  WiserHubAuthenticationError,
168
168
  WiserHubRESTError,
169
+ Exception,
169
170
  ) as ex:
170
171
  _LOGGER.debug("Update from Wiser hub failed. %s", ex)
171
172
  raise ex
@@ -266,6 +267,7 @@ class WiserAPI:
266
267
  WiserHubConnectionError,
267
268
  WiserHubAuthenticationError,
268
269
  WiserHubRESTError,
270
+ Exception,
269
271
  ) as ex:
270
272
  raise ex
271
273
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.5.12
3
+ Version: 1.5.14
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
@@ -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.12
21
+ # Drayton Wiser Hub API Async v1.5.14
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,18 @@ Documentation available in [info.md](https://github.com/msp1974/wiserHeatAPIv2/b
72
72
 
73
73
  ## Changelog
74
74
 
75
+ ### v1.5.14
76
+
77
+ * Fix presets not using defined boost temp
78
+ * Set return value of energy sensors to None if not provided by hub
79
+ * Updated headers for hub query
80
+
81
+ ### v1.5.13
82
+
83
+ * Updates to support v2 hub functions - @LGO44
84
+ * Add connection timeout to new retry function
85
+ * Increase http timeout from 10s to 20s
86
+
75
87
  ### v1.5.12
76
88
 
77
89
  * Improve performance of hub read and retries