aioWiserHeatAPI 1.7.9__tar.gz → 1.7.11__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.7.9 → aiowiserheatapi-1.7.11}/PKG-INFO +1 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/__init__.py +1 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/const.py +15 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/automations.py +3 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/opentherm.py +13 -3
- aiowiserheatapi-1.7.11/aioWiserHeatAPI/helpers/tariffs.py +120 -0
- aiowiserheatapi-1.7.11/aioWiserHeatAPI/helpers/weather.py +27 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/rest_controller.py +2 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/room.py +31 -8
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/schedule.py +58 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/shutter.py +52 -3
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/system.py +52 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/wiserhub.py +45 -7
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/PKG-INFO +1 -1
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/SOURCES.txt +7 -1
- aiowiserheatapi-1.7.11/tests/test_heating_state.py +269 -0
- aiowiserheatapi-1.7.11/tests/test_smart_schedule.py +57 -0
- aiowiserheatapi-1.7.11/tests/test_tariffs.py +147 -0
- aiowiserheatapi-1.7.11/tests/test_weather.py +36 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/LICENSE +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/README.md +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/automation.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/binary_sensor.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/boiler_interface.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/button_panel.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/cli.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/devices.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/discovery.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/equipments.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/evse.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/exceptions.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/heating.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/heating_actuator.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/__init__.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/battery.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/capabilities.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/cloud.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/device.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/equipment.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/extra_config.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/firmware.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/gps.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/misc.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/network.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/signal.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/special_times.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/status.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/temp.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/threshold.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/uiconfiguration.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/version.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/helpers/zigbee.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/hot_water.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/light.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/moments.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/ptc.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/pte.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/refactor.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/roomstat.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/smartplug.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/smartvalve.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/smokealarm.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/temp_humidity.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI/ufh.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/dependency_links.txt +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/entry_points.txt +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/requires.txt +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/aioWiserHeatAPI.egg-info/top_level.txt +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/setup.cfg +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/setup.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_device_notifications.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_equipment.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_equipments.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_evse.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_heating_actuator.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_light.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_ptc.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_rest_controller.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_rest_payloads.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_schedule.py +0 -0
- {aiowiserheatapi-1.7.9 → aiowiserheatapi-1.7.11}/tests/test_smartplug.py +0 -0
|
@@ -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
|
|
@@ -71,6 +71,9 @@ class _WiserHeatingChannelAutomations:
|
|
|
71
71
|
if room.is_passive_mode
|
|
72
72
|
and room.id in heating_channel.room_ids
|
|
73
73
|
and room.current_temperature is not None
|
|
74
|
+
# At a schedule transition the hub's room target can still be
|
|
75
|
+
# from the previous slot. Writing now would create an override.
|
|
76
|
+
and not room.passive_lower_limit_follows_schedule
|
|
74
77
|
]
|
|
75
78
|
|
|
76
79
|
# If no passive mode rooms
|
|
@@ -174,9 +174,11 @@ class _WiserOpentherm(object):
|
|
|
174
174
|
wiser_rest_controller: _WiserRestController,
|
|
175
175
|
data: dict,
|
|
176
176
|
enabled_status: str,
|
|
177
|
+
ever_connected: bool = False,
|
|
177
178
|
):
|
|
178
179
|
self._data = data
|
|
179
180
|
self._enabled_status = enabled_status
|
|
181
|
+
self._ever_connected = ever_connected or enabled_status == "Connected"
|
|
180
182
|
self._wiser_rest_controller = wiser_rest_controller
|
|
181
183
|
|
|
182
184
|
@property
|
|
@@ -219,10 +221,17 @@ class _WiserOpentherm(object):
|
|
|
219
221
|
return tf._from_wiser_temp(self._data.get("ch2FlowSetpoint", None), "current")
|
|
220
222
|
|
|
221
223
|
@property
|
|
222
|
-
def central_heating_active(self) -> bool:
|
|
224
|
+
def central_heating_active(self) -> bool | None:
|
|
223
225
|
"""Return whether the boiler is operating in central-heating mode."""
|
|
224
226
|
slave_status = self.operational_data.slave_status
|
|
225
|
-
|
|
227
|
+
if isinstance(slave_status, bool) or not isinstance(slave_status, int):
|
|
228
|
+
return None
|
|
229
|
+
return bool(slave_status & (1 << 1))
|
|
230
|
+
|
|
231
|
+
@property
|
|
232
|
+
def is_configured(self) -> bool:
|
|
233
|
+
"""Keep a known OpenTherm installation distinct during outages."""
|
|
234
|
+
return self._ever_connected or self.enabled
|
|
226
235
|
|
|
227
236
|
@property
|
|
228
237
|
def connection_status(self) -> str:
|
|
@@ -251,7 +260,8 @@ class _WiserOpentherm(object):
|
|
|
251
260
|
|
|
252
261
|
@property
|
|
253
262
|
def operational_data(self) -> _WiserOpenThermOperationalData:
|
|
254
|
-
|
|
263
|
+
data = self._data.get("operationalData")
|
|
264
|
+
return _WiserOpenThermOperationalData(data if isinstance(data, dict) else {})
|
|
255
265
|
|
|
256
266
|
@property
|
|
257
267
|
def boiler_parameters(self) -> _WiserOpenThermBoilerParameters:
|
|
@@ -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")
|
|
@@ -43,6 +43,7 @@ class WiserAPIParams:
|
|
|
43
43
|
stored_manual_target_temperature_alt_source: str = "current"
|
|
44
44
|
boost_temp_delta: int = DEFAULT_BOOST_DELTA
|
|
45
45
|
hw_climate_mode: bool = False
|
|
46
|
+
opentherm_ever_connected: bool = False
|
|
46
47
|
|
|
47
48
|
|
|
48
49
|
# Connection info class
|
|
@@ -201,7 +202,7 @@ class _WiserRestController(object):
|
|
|
201
202
|
|
|
202
203
|
try:
|
|
203
204
|
async with aiohttp.ClientSession(
|
|
204
|
-
version=http_version, connector=aiohttp.TCPConnector(
|
|
205
|
+
version=http_version, connector=aiohttp.TCPConnector(ssl=False)
|
|
205
206
|
) as session:
|
|
206
207
|
async with session.request(action.value, url, **kwargs) as response:
|
|
207
208
|
await asyncio.sleep(0)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
from math import isfinite
|
|
3
4
|
from typing import Union
|
|
4
5
|
|
|
5
6
|
from aioWiserHeatAPI.helpers.capabilities import _WiserClimateCapabilities
|
|
@@ -254,6 +255,16 @@ class _WiserRoom(object):
|
|
|
254
255
|
)
|
|
255
256
|
return False
|
|
256
257
|
|
|
258
|
+
@property
|
|
259
|
+
def passive_lower_limit_follows_schedule(self) -> bool:
|
|
260
|
+
"""Return whether the hub schedule already supplies the limiter target."""
|
|
261
|
+
return (
|
|
262
|
+
not self.is_override
|
|
263
|
+
and not self.is_away_mode
|
|
264
|
+
and self._auto_uses_scheduled_passive_lower_temp
|
|
265
|
+
and self.passive_mode_lower_temp == self.schedule.current_setting
|
|
266
|
+
)
|
|
267
|
+
|
|
257
268
|
async def set_passive_mode_lower_temp(self, temp):
|
|
258
269
|
if not await self._update_extra_config("min", temp):
|
|
259
270
|
_LOGGER.error(
|
|
@@ -432,18 +443,30 @@ class _WiserRoom(object):
|
|
|
432
443
|
@property
|
|
433
444
|
def is_calling_for_heat(self) -> bool | None:
|
|
434
445
|
"""Return whether the room is requesting heat."""
|
|
435
|
-
|
|
446
|
+
demand = self._data.get("PercentageDemand")
|
|
447
|
+
if (
|
|
448
|
+
isinstance(demand, bool)
|
|
449
|
+
or not isinstance(demand, (int, float))
|
|
450
|
+
or not 0 <= demand <= 100
|
|
451
|
+
or not isfinite(demand)
|
|
452
|
+
):
|
|
436
453
|
return None
|
|
437
|
-
return
|
|
454
|
+
return demand > 0
|
|
438
455
|
|
|
439
456
|
@property
|
|
440
|
-
def is_heating(self) -> bool:
|
|
457
|
+
def is_heating(self) -> bool | None:
|
|
441
458
|
"""Return whether central heating is currently servicing room demand."""
|
|
442
|
-
if self._opentherm and self._opentherm.
|
|
443
|
-
|
|
444
|
-
self.
|
|
445
|
-
|
|
446
|
-
)
|
|
459
|
+
if self._opentherm and self._opentherm.is_configured:
|
|
460
|
+
if (
|
|
461
|
+
self._opentherm.connection_status != "Connected"
|
|
462
|
+
or not self._opentherm.enabled
|
|
463
|
+
):
|
|
464
|
+
return None
|
|
465
|
+
calling = self.is_calling_for_heat
|
|
466
|
+
active = self._opentherm.central_heating_active
|
|
467
|
+
if calling is None or active is None:
|
|
468
|
+
return None
|
|
469
|
+
return calling and active
|
|
447
470
|
return self._data.get("ControlOutputState", TEXT_OFF) == TEXT_ON
|
|
448
471
|
|
|
449
472
|
@property
|
|
@@ -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
|
-
|
|
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"""
|
|
@@ -29,6 +30,7 @@ class _WiserSystem(object):
|
|
|
29
30
|
network_data: dict,
|
|
30
31
|
device_data: dict,
|
|
31
32
|
opentherm_data: dict,
|
|
33
|
+
opentherm_ever_connected: bool = False,
|
|
32
34
|
):
|
|
33
35
|
self._wiser_rest_controller = wiser_rest_controller
|
|
34
36
|
self._data = domain_data
|
|
@@ -53,11 +55,15 @@ class _WiserSystem(object):
|
|
|
53
55
|
self._wiser_rest_controller,
|
|
54
56
|
opentherm_data,
|
|
55
57
|
self._system_data.get("OpenThermConnectionStatus", TEXT_UNKNOWN),
|
|
58
|
+
opentherm_ever_connected,
|
|
56
59
|
)
|
|
57
60
|
self._signal = _WiserSignalStrength(self._device_data)
|
|
58
61
|
self._upgrade_data = _WiserFirmareUpgradeInfo(self._data.get("UpgradeInfo", {}))
|
|
59
62
|
self._zigbee_data = _WiserZigbee(self._data.get("Zigbee", {}))
|
|
60
63
|
|
|
64
|
+
# Weather
|
|
65
|
+
self._weather_data = _WiserWeather(self._data.get("Weather", {}))
|
|
66
|
+
|
|
61
67
|
# Variables to hold values for settabel values
|
|
62
68
|
self._automatic_daylight_saving = self._system_data.get(
|
|
63
69
|
"AutomaticDaylightSaving"
|
|
@@ -91,7 +97,11 @@ class _WiserSystem(object):
|
|
|
91
97
|
self._summer_discomfort_prevention = self._system_data.get(
|
|
92
98
|
"SummerDiscomfortPrevention"
|
|
93
99
|
)
|
|
100
|
+
self._seasonal_comfort_enabled = self._system_data.get(
|
|
101
|
+
"SeasonalComfortEnabled")
|
|
94
102
|
|
|
103
|
+
self._timezone_identifier = self._system_data.get("TimeZoneIdentifier", TEXT_UNKNOWN)
|
|
104
|
+
|
|
95
105
|
# End Added by LGO
|
|
96
106
|
|
|
97
107
|
def _get_system_device(self, device_data: dict):
|
|
@@ -334,6 +344,18 @@ class _WiserSystem(object):
|
|
|
334
344
|
self._summer_comfort_enabled = enabled
|
|
335
345
|
return True
|
|
336
346
|
|
|
347
|
+
# Wiser app V7 seasonnal comfort
|
|
348
|
+
|
|
349
|
+
@property
|
|
350
|
+
def seasonal_comfort_enabled(self) -> bool:
|
|
351
|
+
"""Get or set if seasonal comfort is enabled"""
|
|
352
|
+
return self._seasonal_comfort_enabled
|
|
353
|
+
|
|
354
|
+
async def set_seasonal_comfort_enabled(self, enabled: bool):
|
|
355
|
+
if await self._send_command({"SeasonalComfortEnabled": enabled}):
|
|
356
|
+
self._seasonal_comfort_enabled = enabled
|
|
357
|
+
return True
|
|
358
|
+
|
|
337
359
|
@property
|
|
338
360
|
def indoor_discomfort_temperature(self) -> float:
|
|
339
361
|
"""Get indoor discomfort temperature for summer comfort"""
|
|
@@ -379,6 +401,11 @@ class _WiserSystem(object):
|
|
|
379
401
|
"""Get type of zigbee device"""
|
|
380
402
|
return self._device_data.get("Type", TEXT_UNKNOWN)
|
|
381
403
|
|
|
404
|
+
@property
|
|
405
|
+
def weather(self) -> _WiserWeather:
|
|
406
|
+
"""Get weather info"""
|
|
407
|
+
return self._weather_data
|
|
408
|
+
|
|
382
409
|
@property
|
|
383
410
|
def uuid(self) -> str:
|
|
384
411
|
"""Get UUID zigbee"""
|
|
@@ -405,6 +432,26 @@ class _WiserSystem(object):
|
|
|
405
432
|
"""Get Can activate PCM"""
|
|
406
433
|
return self._system_data.get("CanActivatePCM", False)
|
|
407
434
|
|
|
435
|
+
@property
|
|
436
|
+
def pcm_online(self) -> bool:
|
|
437
|
+
"""Get PCM online"""
|
|
438
|
+
return self._system_data.get("PCMOnline", False)
|
|
439
|
+
|
|
440
|
+
@property
|
|
441
|
+
def wec_version(self) -> str:
|
|
442
|
+
"""Get WEC Web Energy Center version"""
|
|
443
|
+
return self._system_data.get("WECVersion", TEXT_UNKNOWN)
|
|
444
|
+
|
|
445
|
+
@property
|
|
446
|
+
def wes_status_available(self) -> bool:
|
|
447
|
+
"""Get WES Web Energy Supervisor status available"""
|
|
448
|
+
return self._system_data.get("WESStatusAvailable", False)
|
|
449
|
+
|
|
450
|
+
@property
|
|
451
|
+
def rmb_follow_smart(self) -> bool:
|
|
452
|
+
"""Get RMB Rduce My Bill follow smart"""
|
|
453
|
+
return self._system_data.get("RMBFollowSmart", False)
|
|
454
|
+
|
|
408
455
|
# End Added LGO
|
|
409
456
|
|
|
410
457
|
@property
|
|
@@ -422,6 +469,11 @@ class _WiserSystem(object):
|
|
|
422
469
|
"""Get current system mode"""
|
|
423
470
|
return self._system_data.get("SystemMode", TEXT_UNKNOWN)
|
|
424
471
|
|
|
472
|
+
@property
|
|
473
|
+
def timezone_identifier(self) -> str:
|
|
474
|
+
"""Get the timezone identifier reported by the hub."""
|
|
475
|
+
return self._timezone_identifier
|
|
476
|
+
|
|
425
477
|
@property
|
|
426
478
|
def timezone_offset(self) -> int:
|
|
427
479
|
"""Get timezone offset in minutes"""
|