aioWiserHeatAPI 1.7.10__tar.gz → 1.7.12b0__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 (81) hide show
  1. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/PKG-INFO +1 -1
  2. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/__init__.py +1 -1
  3. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/const.py +15 -1
  4. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/opentherm.py +12 -3
  5. aiowiserheatapi-1.7.12b0/aioWiserHeatAPI/helpers/tariffs.py +120 -0
  6. aiowiserheatapi-1.7.12b0/aioWiserHeatAPI/helpers/weather.py +27 -0
  7. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/rest_controller.py +1 -1
  8. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/schedule.py +58 -1
  9. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/shutter.py +52 -3
  10. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/system.py +51 -0
  11. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/wiserhub.py +38 -1
  12. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/PKG-INFO +1 -1
  13. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/SOURCES.txt +6 -1
  14. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_heating_state.py +100 -2
  15. aiowiserheatapi-1.7.12b0/tests/test_smart_schedule.py +57 -0
  16. aiowiserheatapi-1.7.12b0/tests/test_tariffs.py +147 -0
  17. aiowiserheatapi-1.7.12b0/tests/test_weather.py +36 -0
  18. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/LICENSE +0 -0
  19. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/README.md +0 -0
  20. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/automation.py +0 -0
  21. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/binary_sensor.py +0 -0
  22. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/boiler_interface.py +0 -0
  23. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/button_panel.py +0 -0
  24. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/cli.py +0 -0
  25. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/devices.py +0 -0
  26. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/discovery.py +0 -0
  27. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/equipments.py +0 -0
  28. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/evse.py +0 -0
  29. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/exceptions.py +0 -0
  30. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/heating.py +0 -0
  31. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/heating_actuator.py +0 -0
  32. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/__init__.py +0 -0
  33. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/automations.py +0 -0
  34. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/battery.py +0 -0
  35. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
  36. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/cloud.py +0 -0
  37. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/device.py +0 -0
  38. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/equipment.py +0 -0
  39. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
  40. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/firmware.py +0 -0
  41. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/gps.py +0 -0
  42. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/misc.py +0 -0
  43. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/network.py +0 -0
  44. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/signal.py +0 -0
  45. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/special_times.py +0 -0
  46. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/status.py +0 -0
  47. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/temp.py +0 -0
  48. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/threshold.py +0 -0
  49. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/uiconfiguration.py +0 -0
  50. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/version.py +0 -0
  51. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
  52. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/hot_water.py +0 -0
  53. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/light.py +0 -0
  54. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/moments.py +0 -0
  55. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/ptc.py +0 -0
  56. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/pte.py +0 -0
  57. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/refactor.py +0 -0
  58. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/room.py +0 -0
  59. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/roomstat.py +0 -0
  60. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/smartplug.py +0 -0
  61. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/smartvalve.py +0 -0
  62. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/smokealarm.py +0 -0
  63. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/temp_humidity.py +0 -0
  64. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI/ufh.py +0 -0
  65. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
  66. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
  67. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/requires.txt +0 -0
  68. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
  69. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/setup.cfg +0 -0
  70. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/setup.py +0 -0
  71. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_device_notifications.py +0 -0
  72. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_equipment.py +0 -0
  73. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_equipments.py +0 -0
  74. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_evse.py +0 -0
  75. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_heating_actuator.py +0 -0
  76. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_light.py +0 -0
  77. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_ptc.py +0 -0
  78. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_rest_controller.py +0 -0
  79. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_rest_payloads.py +0 -0
  80. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_schedule.py +0 -0
  81. {aiowiserheatapi-1.7.10 → aiowiserheatapi-1.7.12b0}/tests/test_smartplug.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.7.10
3
+ Version: 1.7.12b0
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
@@ -3,6 +3,6 @@ import logging
3
3
  name = "aioWiserHeatAPI"
4
4
  __all__ = ["wiserAPI", "wiserDiscovery"]
5
5
 
6
- __VERSION__ = "1.7.10"
6
+ __VERSION__ = "1.7.12b0"
7
7
 
8
8
  _LOGGER = logging.getLogger(__name__)
@@ -78,6 +78,11 @@ TEXT_RL_LED = "RL_LED"
78
78
  TEXT_RELAY = "Relay"
79
79
  TEXT_FIL_PILOTE = "FilPilote"
80
80
 
81
+ # Text for Tariffs
82
+ TEXT_ENERGYTARIFFS = "EnergyTariffs"
83
+ TEXT_FORECAST = "Forecast"
84
+ TEXT_CURRENTDAY = "CurrentDay"
85
+
81
86
  # Day Value Lists
82
87
  WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]
83
88
  WEEKENDS = ["Saturday", "Sunday"]
@@ -117,7 +122,8 @@ WISEREQUIPMENT = "Equipment/{}"
117
122
  WISERTHRESHOLDSENSOR = "ThresholdSensor/{}"
118
123
  WISERUICONFIGURATION = "UIConfiguration/{}"
119
124
  WISERAUTOMATION = "Automation/{}"
120
-
125
+ WISERTARIFFS = "Tariffs/{}" #add Energytariffs monitoring
126
+ WISERWEATHER = "Weather"
121
127
 
122
128
  # Enums
123
129
  class WiserUnitsEnum(enum.Enum):
@@ -235,3 +241,11 @@ DEFAULT_LEVEL_SCHEDULE = {
235
241
  "Saturday": {"Time": [], "Level": []},
236
242
  "Sunday": {"Time": [], "Level": []},
237
243
  }
244
+
245
+ class WiserTariffTypeEnum(enum.Enum):
246
+ energytariffs = TEXT_ENERGYTARIFFS
247
+
248
+
249
+ class WiserEnergyTariffTypeEnum(enum.Enum):
250
+ forecast = TEXT_FORECAST
251
+ currentday = TEXT_CURRENTDAY
@@ -175,10 +175,12 @@ class _WiserOpentherm(object):
175
175
  data: dict,
176
176
  enabled_status: str,
177
177
  ever_connected: bool = False,
178
+ control_type: str | None = None,
178
179
  ):
179
180
  self._data = data
180
181
  self._enabled_status = enabled_status
181
182
  self._ever_connected = ever_connected or enabled_status == "Connected"
183
+ self._control_type = control_type
182
184
  self._wiser_rest_controller = wiser_rest_controller
183
185
 
184
186
  @property
@@ -230,8 +232,15 @@ class _WiserOpentherm(object):
230
232
 
231
233
  @property
232
234
  def is_configured(self) -> bool:
233
- """Keep a known OpenTherm installation distinct during outages."""
234
- return self._ever_connected or self.enabled
235
+ """Prefer explicit boiler control type, including during startup outages."""
236
+ if self._control_type == "HeatSourceType_OpenTherm":
237
+ return True
238
+ return not self.is_relay_controlled and (self._ever_connected or self.enabled)
239
+
240
+ @property
241
+ def is_relay_controlled(self) -> bool:
242
+ """Explicit relay configuration overrides misleading connection status."""
243
+ return self._control_type == "HeatSourceType_RelayControlled"
235
244
 
236
245
  @property
237
246
  def connection_status(self) -> str:
@@ -241,7 +250,7 @@ class _WiserOpentherm(object):
241
250
  @property
242
251
  def enabled(self) -> bool:
243
252
  """Get Enabled"""
244
- return self._data.get("Enabled", False)
253
+ return not self.is_relay_controlled and self._data.get("Enabled", False)
245
254
 
246
255
  @property
247
256
  def hw_enabled(self) -> bool:
@@ -0,0 +1,120 @@
1
+ """Data models for the tariff information returned by a Wiser hub."""
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+
6
+ class _TariffInterval:
7
+ """A single tariff interval."""
8
+
9
+ def __init__(self, data: Dict[str, Any]):
10
+ self._data = data or {}
11
+
12
+ @property
13
+ def id(self) -> Optional[int]:
14
+ return self._data.get("id")
15
+
16
+ @property
17
+ def begin(self) -> Optional[str]:
18
+ """Start of the interval, as returned by the hub."""
19
+ return self._data.get("from")
20
+
21
+ @property
22
+ def end(self) -> Optional[str]:
23
+ """End of the interval, as returned by the hub."""
24
+ return self._data.get("to")
25
+
26
+ @property
27
+ def price(self) -> Optional[float]:
28
+ return self._data.get("price")
29
+
30
+
31
+ class _TariffIntervals:
32
+ """A list of tariff intervals, such as Forecast or CurrentDay."""
33
+
34
+ def __init__(self, data: Optional[List[Dict[str, Any]]] = None):
35
+ self._intervals = [
36
+ _TariffInterval(interval) for interval in (data or [])
37
+ ]
38
+
39
+ @property
40
+ def all(self) -> List[_TariffInterval]:
41
+ return list(self._intervals)
42
+
43
+ @property
44
+ def count(self) -> int:
45
+ return len(self._intervals)
46
+
47
+ def __iter__(self):
48
+ return iter(self._intervals)
49
+
50
+ def __len__(self) -> int:
51
+ return len(self._intervals)
52
+
53
+
54
+ class _EnergyTariff:
55
+ """Tariff data containing forecast, current day, and price summaries."""
56
+
57
+ def __init__(self, data: Optional[Dict[str, Any]] = None):
58
+ self._data = data or {}
59
+
60
+ @property
61
+ def forecast(self) -> _TariffIntervals:
62
+ return _TariffIntervals(self._data.get("Forecast"))
63
+
64
+ @property
65
+ def current_day(self) -> _TariffIntervals:
66
+ return _TariffIntervals(self._data.get("CurrentDay"))
67
+
68
+ @property
69
+ def daily_average(self) -> Optional[float]:
70
+ return self._data.get("DailyAverage")
71
+
72
+ @property
73
+ def daily_averagex100(self) -> Optional[float]:
74
+ return self._data.get("DailyAverage100Multiplier")
75
+
76
+ @property
77
+ def current_price(self) -> Optional[float]:
78
+ return self._data.get("CurrentPrice")
79
+
80
+ @property
81
+ def current_pricex100(self) -> Optional[float]:
82
+ return self._data.get("CurrentPrice100Multiplier")
83
+
84
+
85
+ class _WiserTariffs:
86
+ """Top-level Tariffs response from the Wiser hub."""
87
+
88
+ def __init__(self, tariff_data: Optional[Dict[str, Any]] = None):
89
+ data = tariff_data or {}
90
+ # Accept either the full response (containing EnergyTariff) or the
91
+ # EnergyTariff object itself.
92
+ self._energy_tariff_data = data.get("EnergyTariff", data)
93
+
94
+ @property
95
+ def energy_tariff(self) -> _EnergyTariff:
96
+ return _EnergyTariff(self._energy_tariff_data)
97
+
98
+ @property
99
+ def forecast(self) -> _TariffIntervals:
100
+ return self.energy_tariff.forecast
101
+
102
+ @property
103
+ def current_day(self) -> _TariffIntervals:
104
+ return self.energy_tariff.current_day
105
+
106
+ @property
107
+ def daily_average(self) -> Optional[float]:
108
+ return self.energy_tariff.daily_average
109
+
110
+ @property
111
+ def daily_averagex100(self) -> Optional[float]:
112
+ return self.energy_tariff.daily_averagex100
113
+
114
+ @property
115
+ def current_price(self) -> Optional[float]:
116
+ return self.energy_tariff.current_price
117
+
118
+ @property
119
+ def current_pricex100(self) -> Optional[float]:
120
+ return self.energy_tariff.current_pricex100
@@ -0,0 +1,27 @@
1
+ """
2
+ Handles weather data
3
+ """
4
+
5
+ from ..const import TEMP_ERROR
6
+
7
+
8
+ class _WiserWeather:
9
+ def __init__(self, weather_data: dict):
10
+ self._weather_data = weather_data
11
+
12
+ def _get_temperature(self, key: str) -> float | None:
13
+ """Convert weather readings without applying indoor temperature limits."""
14
+ temperature = self._weather_data.get(key)
15
+ if temperature is None or abs(temperature) >= TEMP_ERROR:
16
+ return None
17
+ return round(temperature / 10, 1)
18
+
19
+ @property
20
+ def temperature(self) -> float | None:
21
+ """Get the outside temperature."""
22
+ return self._get_temperature("Temperature")
23
+
24
+ @property
25
+ def next_day_2pm_temperature(self) -> float | None:
26
+ """Get the outside temperature next day at 2PM"""
27
+ return self._get_temperature("NextDay2pmTemperature")
@@ -202,7 +202,7 @@ class _WiserRestController(object):
202
202
 
203
203
  try:
204
204
  async with aiohttp.ClientSession(
205
- version=http_version, connector=aiohttp.TCPConnector(verify_ssl=False)
205
+ version=http_version, connector=aiohttp.TCPConnector(ssl=False)
206
206
  ) as session:
207
207
  async with session.request(action.value, url, **kwargs) as response:
208
208
  await asyncio.sleep(0)
@@ -171,6 +171,7 @@ class _WiserSchedule:
171
171
  """
172
172
  return None
173
173
 
174
+
174
175
  def _convert_yaml_to_wiser_day(self, day_schedule) -> list | None:
175
176
  """
176
177
  Convert from yaml format to wiser v2 schedule format.
@@ -508,6 +509,43 @@ class _WiserSchedule:
508
509
  )
509
510
 
510
511
 
512
+ class _WiserSmartSchedule:
513
+ """Read-only Smart overview data returned alongside regular schedules."""
514
+
515
+ def __init__(self, schedule_data: dict):
516
+ self._schedule_data = schedule_data
517
+
518
+ @property
519
+ def id(self) -> int | None:
520
+ return self._schedule_data.get("id")
521
+
522
+ @property
523
+ def schedule_type(self) -> str:
524
+ return "Smart"
525
+
526
+ @property
527
+ def rolling24h_view(self) -> dict:
528
+ """Return the Rolling24HView details without altering the hub payload."""
529
+ return self._schedule_data.get("Rolling24HView") or {}
530
+
531
+ @property
532
+ def expiration_date(self) -> str | None:
533
+ return self.rolling24h_view.get("expirationDate")
534
+
535
+ @property
536
+ def current_state(self) -> str | None:
537
+ return self.rolling24h_view.get("currentState")
538
+
539
+ @property
540
+ def commands(self) -> list[dict]:
541
+ return self.rolling24h_view.get("commands", [])
542
+
543
+ @property
544
+ def schedule_data(self) -> dict:
545
+ """Return the raw Smart entry, including any fields added by the hub."""
546
+ return self._schedule_data
547
+
548
+
511
549
  class _WiserHeatingSchedule(_WiserSchedule):
512
550
  """Class for Wiser Heating Schedule"""
513
551
 
@@ -950,12 +988,16 @@ class _WiserScheduleCollection(object):
950
988
  self._heating_schedules = []
951
989
  self._onoff_schedules = []
952
990
  self._level_schedules = []
991
+ self._smart_schedules = []
953
992
 
954
993
  self._build(schedule_data)
955
994
 
956
995
  def _build(self, schedule_data):
957
996
  for schedule_type in schedule_data:
958
- for schedule in schedule_data.get(schedule_type):
997
+ schedules = schedule_data.get(schedule_type) or []
998
+ if schedule_type == "Smart" and isinstance(schedules, dict):
999
+ schedules = [schedules]
1000
+ for schedule in schedules:
959
1001
  if schedule_type == WiserScheduleTypeEnum.heating.value:
960
1002
  self._heating_schedules.append(
961
1003
  _WiserHeatingSchedule(
@@ -986,6 +1028,11 @@ class _WiserScheduleCollection(object):
986
1028
  self._sunsets,
987
1029
  )
988
1030
  )
1031
+ if schedule_type == "Smart":
1032
+ self._smart_schedules.extend(
1033
+ _WiserSmartSchedule(item)
1034
+ for item in (schedule.get("Overview") or [])
1035
+ )
989
1036
 
990
1037
  async def _send_schedule_command(
991
1038
  self, action: str, schedule_data: dict, id: int = 0
@@ -1030,6 +1077,16 @@ class _WiserScheduleCollection(object):
1030
1077
  def onoff_schedules(self) -> list[_WiserOnOffSchedule]:
1031
1078
  return self._onoff_schedules
1032
1079
 
1080
+ @property
1081
+ def smart_schedules(self) -> list[_WiserSmartSchedule]:
1082
+ """List Smart overview schedules (read-only hub data)."""
1083
+ return self._smart_schedules
1084
+
1085
+ @property
1086
+ def smarts(self) -> list[_WiserSmartSchedule]:
1087
+ """Alias for :attr:`smart_schedules`."""
1088
+ return self._smart_schedules
1089
+
1033
1090
  def get_by_id(
1034
1091
  self, schedule_type: WiserScheduleTypeEnum, schedule_id: int
1035
1092
  ) -> _WiserHeatingSchedule | _WiserLevelSchedule | _WiserOnOffSchedule | None:
@@ -9,7 +9,6 @@ from .const import (
9
9
  )
10
10
  from .helpers.device import _WiserElectricalDevice
11
11
 
12
-
13
12
  class _WiserLiftMovementRange(object):
14
13
  """Data structure for min/max output range"""
15
14
 
@@ -91,7 +90,6 @@ class _WiserLiftMovementRange(object):
91
90
  """Set tilt enable"""
92
91
  return await self._shutter_instance._send_command({"TiltEnabled": en})
93
92
 
94
-
95
93
  class _WiserShutter(_WiserElectricalDevice):
96
94
  """Class representing a Wiser Shutter device"""
97
95
 
@@ -266,6 +264,9 @@ class _WiserShutter(_WiserElectricalDevice):
266
264
  if await self._send_command({"RespectSummerComfort": en}):
267
265
  return True
268
266
 
267
+
268
+
269
+
269
270
  @property
270
271
  def summer_comfort_lift(self) -> int:
271
272
  """Get the shutter summer comfort lift"""
@@ -286,6 +287,55 @@ class _WiserShutter(_WiserElectricalDevice):
286
287
  self._summer_comfort_tilt = tilt
287
288
  return True
288
289
 
290
+ #Added by LGO Seasonal comfort
291
+ @property
292
+ def respect_seasonal_comfort(self) -> bool:
293
+ """Get if the shutter respect seasonal comfort"""
294
+ return self._device_type_data.get("RespectSeasonalComfort", False)
295
+
296
+ async def set_respect_seasonal_comfort(self, en: bool):
297
+ """Set respect seasonal comfort"""
298
+ if await self._send_command({"RespectSeasonalComfort": en}):
299
+ return True
300
+
301
+ @property
302
+ def seasonal_target_lift(self) -> int:
303
+ """Get seasonal target lift of shutter"""
304
+ return self._device_type_data.get("SeasonalTargetLift", 0)
305
+
306
+ async def set_seasonal_target_lift(self, lift: int):
307
+ if await self._send_command({"SeasonalTargetLift": lift}):
308
+ self._seasonal_target_lift = lift
309
+ return True
310
+
311
+ @property
312
+ def facade(self) -> str:
313
+ """Get facade of shutter"""
314
+ return self._device_type_data.get("Facade", TEXT_UNKNOWN)
315
+
316
+ @property
317
+ def room_with_temperature_sensor (self) -> int:
318
+ """Get the index of the temperature sensor of the room for shutter"""
319
+ return self._device_type_data.get("RoomWithTemperatureSensor", 0)
320
+
321
+ @property
322
+ def use_average_temperature (self) -> bool:
323
+ """Get use average temperature of shutter"""
324
+ return self._device_type_data.get("UseAverageTemperature", False)
325
+
326
+ @property
327
+ def seasonal_derogation_utc_timestamp (self) -> int:
328
+ """Get derogation timestamp of shutter"""
329
+ return self._device_type_data.get("SeasonalDerogationUtcTimestamp", False)
330
+
331
+ @property
332
+ def covering_type (self) -> str:
333
+ """Get the covering type Door?"""
334
+ return self._device_type_data.get("CoveringType", TEXT_UNKNOWN)
335
+
336
+ #End Added by LGO Seasonal comfort
337
+
338
+
289
339
  async def open(self, percentage: int = 100):
290
340
  """Fully open shutter"""
291
341
  if percentage >= 0 and percentage <= 100:
@@ -340,7 +390,6 @@ class _WiserShutter(_WiserElectricalDevice):
340
390
  {"RequestAction": {"Action": "StopTilt"}}
341
391
  )
342
392
 
343
-
344
393
  class _WiserShutterCollection(object):
345
394
  """Class holding all wiser heating actuators"""
346
395
 
@@ -18,6 +18,7 @@ from .helpers.temp import _WiserTemperatureFunctions as tf
18
18
  from .helpers.zigbee import _WiserZigbee
19
19
  from .rest_controller import _WiserRestController
20
20
 
21
+ from .helpers.weather import _WiserWeather
21
22
 
22
23
  class _WiserSystem(object):
23
24
  """Class representing a Wiser Hub device"""
@@ -55,11 +56,15 @@ class _WiserSystem(object):
55
56
  opentherm_data,
56
57
  self._system_data.get("OpenThermConnectionStatus", TEXT_UNKNOWN),
57
58
  opentherm_ever_connected,
59
+ (self._system_data.get("BoilerSettings") or {}).get("ControlType"),
58
60
  )
59
61
  self._signal = _WiserSignalStrength(self._device_data)
60
62
  self._upgrade_data = _WiserFirmareUpgradeInfo(self._data.get("UpgradeInfo", {}))
61
63
  self._zigbee_data = _WiserZigbee(self._data.get("Zigbee", {}))
62
64
 
65
+ # Weather
66
+ self._weather_data = _WiserWeather(self._data.get("Weather", {}))
67
+
63
68
  # Variables to hold values for settabel values
64
69
  self._automatic_daylight_saving = self._system_data.get(
65
70
  "AutomaticDaylightSaving"
@@ -93,7 +98,11 @@ class _WiserSystem(object):
93
98
  self._summer_discomfort_prevention = self._system_data.get(
94
99
  "SummerDiscomfortPrevention"
95
100
  )
101
+ self._seasonal_comfort_enabled = self._system_data.get(
102
+ "SeasonalComfortEnabled")
96
103
 
104
+ self._timezone_identifier = self._system_data.get("TimeZoneIdentifier", TEXT_UNKNOWN)
105
+
97
106
  # End Added by LGO
98
107
 
99
108
  def _get_system_device(self, device_data: dict):
@@ -336,6 +345,18 @@ class _WiserSystem(object):
336
345
  self._summer_comfort_enabled = enabled
337
346
  return True
338
347
 
348
+ # Wiser app V7 seasonnal comfort
349
+
350
+ @property
351
+ def seasonal_comfort_enabled(self) -> bool:
352
+ """Get or set if seasonal comfort is enabled"""
353
+ return self._seasonal_comfort_enabled
354
+
355
+ async def set_seasonal_comfort_enabled(self, enabled: bool):
356
+ if await self._send_command({"SeasonalComfortEnabled": enabled}):
357
+ self._seasonal_comfort_enabled = enabled
358
+ return True
359
+
339
360
  @property
340
361
  def indoor_discomfort_temperature(self) -> float:
341
362
  """Get indoor discomfort temperature for summer comfort"""
@@ -381,6 +402,11 @@ class _WiserSystem(object):
381
402
  """Get type of zigbee device"""
382
403
  return self._device_data.get("Type", TEXT_UNKNOWN)
383
404
 
405
+ @property
406
+ def weather(self) -> _WiserWeather:
407
+ """Get weather info"""
408
+ return self._weather_data
409
+
384
410
  @property
385
411
  def uuid(self) -> str:
386
412
  """Get UUID zigbee"""
@@ -407,6 +433,26 @@ class _WiserSystem(object):
407
433
  """Get Can activate PCM"""
408
434
  return self._system_data.get("CanActivatePCM", False)
409
435
 
436
+ @property
437
+ def pcm_online(self) -> bool:
438
+ """Get PCM online"""
439
+ return self._system_data.get("PCMOnline", False)
440
+
441
+ @property
442
+ def wec_version(self) -> str:
443
+ """Get WEC Web Energy Center version"""
444
+ return self._system_data.get("WECVersion", TEXT_UNKNOWN)
445
+
446
+ @property
447
+ def wes_status_available(self) -> bool:
448
+ """Get WES Web Energy Supervisor status available"""
449
+ return self._system_data.get("WESStatusAvailable", False)
450
+
451
+ @property
452
+ def rmb_follow_smart(self) -> bool:
453
+ """Get RMB Rduce My Bill follow smart"""
454
+ return self._system_data.get("RMBFollowSmart", False)
455
+
410
456
  # End Added LGO
411
457
 
412
458
  @property
@@ -424,6 +470,11 @@ class _WiserSystem(object):
424
470
  """Get current system mode"""
425
471
  return self._system_data.get("SystemMode", TEXT_UNKNOWN)
426
472
 
473
+ @property
474
+ def timezone_identifier(self) -> str:
475
+ """Get the timezone identifier reported by the hub."""
476
+ return self._timezone_identifier
477
+
427
478
  @property
428
479
  def timezone_offset(self) -> int:
429
480
  """Get timezone offset in minutes"""
@@ -39,6 +39,8 @@ from .const import (
39
39
  WISERHUBSCHEDULES,
40
40
  WISERHUBSTATUS,
41
41
  WISERHUBURL,
42
+ WISERTARIFFS,
43
+ WiserTariffTypeEnum,
42
44
  WiserUnitsEnum,
43
45
  )
44
46
  from .automation import _WiserAutomationCollection
@@ -52,6 +54,7 @@ from .exceptions import (
52
54
  from .heating import _WiserHeatingChannelCollection
53
55
  from .helpers.automations import _WiserHeatingChannelAutomations
54
56
  from .helpers.status import WiserStatus
57
+ from .helpers.tariffs import _WiserTariffs
55
58
  from .hot_water import _WiserHotwater
56
59
  from .moments import _WiserMomentCollection
57
60
  from .refactor import refactor
@@ -97,6 +100,7 @@ class WiserAPI:
97
100
  self._schedule_data = {}
98
101
  self._opentherm_data = {}
99
102
  self._status_data = {}
103
+ self._tariff_data = {}
100
104
 
101
105
  # Data stores for exposed properties
102
106
  self._devices = None
@@ -107,6 +111,7 @@ class WiserAPI:
107
111
  self._rooms = None
108
112
  self._schedules = None
109
113
  self._system = None
114
+ self._tariffs = _WiserTariffs()
110
115
 
111
116
  self._enable_automations = enable_automations
112
117
  self._extra_config_file = extra_config_file
@@ -196,12 +201,36 @@ class WiserAPI:
196
201
  except WiserHubRESTError:
197
202
  self._status_data = {}
198
203
 
204
+ # Some hub firmware includes tariffs in the main domain response;
205
+ # use that data before trying the optional dedicated endpoint.
206
+ self._tariff_data = self._domain_data.get("Tariffs", {})
207
+ if not self._tariff_data:
208
+ try:
209
+ self._tariff_data = await self._wiser_rest_controller.get_hub_data(
210
+ WISERHUBURL
211
+ + WISERTARIFFS.format(WiserTariffTypeEnum.energytariffs.value),
212
+ raise_for_endpoint_error=False,
213
+ )
214
+ except (WiserHubConnectionError, WiserHubRESTError) as ex:
215
+ _LOGGER.warning(
216
+ "Unable to retrieve optional energy tariff data: %s", ex
217
+ )
218
+ self._tariff_data = {}
219
+
220
+ # Only get opentherm data if connected
199
221
  # Do not let an optional boiler endpoint invalidate fresh hub data.
200
222
  opentherm = self._domain_data.get("System", {}).get(
201
223
  "OpenThermConnectionStatus", ""
202
224
  )
203
225
  self._opentherm_data = {}
204
- if opentherm == "Connected":
226
+ relay_controlled = (
227
+ (self._domain_data.get("System", {}).get("BoilerSettings") or {}).get(
228
+ "ControlType"
229
+ ) == "HeatSourceType_RelayControlled"
230
+ )
231
+ if relay_controlled:
232
+ self.api_parameters.opentherm_ever_connected = False
233
+ if opentherm == "Connected" and not relay_controlled:
205
234
  self.api_parameters.opentherm_ever_connected = True
206
235
  fw_version = Version(
207
236
  self._domain_data.get("System", {}).get(
@@ -257,6 +286,8 @@ class WiserAPI:
257
286
  await self._wiser_rest_controller.get_extra_config_data()
258
287
 
259
288
  if self._domain_data != {} and self._network_data != {}:
289
+ self._tariffs = _WiserTariffs(self._tariff_data)
290
+
260
291
  # System Object
261
292
  _device_data = self._domain_data.get("Device", [])
262
293
  self._system = _WiserSystem(
@@ -381,6 +412,11 @@ class WiserAPI:
381
412
  """Hub status info"""
382
413
  return WiserStatus(self._status_data)
383
414
 
415
+ @property
416
+ def tariffs(self) -> _WiserTariffs:
417
+ """Energy tariff information reported by the hub."""
418
+ return self._tariffs
419
+
384
420
  @property
385
421
  def system(self) -> _WiserSystem:
386
422
  """Entity of the Wiser Hub"""
@@ -409,6 +445,7 @@ class WiserAPI:
409
445
  "Schedule": self._schedule_data,
410
446
  "OpenTherm": self._opentherm_data,
411
447
  "Status": self._status_data,
448
+ "Tariffs": self._tariff_data,
412
449
  }
413
450
 
414
451
  # @property
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aioWiserHeatAPI
3
- Version: 1.7.10
3
+ Version: 1.7.12b0
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
@@ -56,10 +56,12 @@ aioWiserHeatAPI/helpers/opentherm.py
56
56
  aioWiserHeatAPI/helpers/signal.py
57
57
  aioWiserHeatAPI/helpers/special_times.py
58
58
  aioWiserHeatAPI/helpers/status.py
59
+ aioWiserHeatAPI/helpers/tariffs.py
59
60
  aioWiserHeatAPI/helpers/temp.py
60
61
  aioWiserHeatAPI/helpers/threshold.py
61
62
  aioWiserHeatAPI/helpers/uiconfiguration.py
62
63
  aioWiserHeatAPI/helpers/version.py
64
+ aioWiserHeatAPI/helpers/weather.py
63
65
  aioWiserHeatAPI/helpers/zigbee.py
64
66
  tests/test_device_notifications.py
65
67
  tests/test_equipment.py
@@ -72,4 +74,7 @@ tests/test_ptc.py
72
74
  tests/test_rest_controller.py
73
75
  tests/test_rest_payloads.py
74
76
  tests/test_schedule.py
75
- tests/test_smartplug.py
77
+ tests/test_smart_schedule.py
78
+ tests/test_smartplug.py
79
+ tests/test_tariffs.py
80
+ tests/test_weather.py