Skip to content

Commit 0ce53a9

Browse files
authored
Merge pull request #330 from plugwise/max_dw_fix
Fix domestic_hot_water_setpoint bug happening in Anna + Elga system
2 parents 5c92c79 + ab43999 commit 0ce53a9

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Changelog
22

3-
## Ongoing
3+
## V0.31.6: Fix domestic_hot_water_setpoint-related bug for Anna + Elga
44

5+
- Add guarding for popping domestic_hot_water_setpoint
56
- Improved fixture generation and prettifying
67

78
## v0.31.5: Cooling-related fix/improvements

plugwise/constants.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,9 @@
5858
DEFAULT_PORT: Final = 80
5959
DEFAULT_PW_MAX: Final = 30.0
6060
DEFAULT_PW_MIN: Final = 4.0
61-
NONE: Final = "None"
61+
DHW_SETPOINT: Final = "domestic_hot_water_setpoint"
6262
FAKE_APPL: Final = "aaaa0000aaaa0000aaaa0000aaaa00aa"
6363
FAKE_LOC: Final = "0000aaaa0000aaaa0000aaaa0000aa00"
64-
LEGACY_SMILES: Final[tuple[str, ...]] = (
65-
"smile_thermo_v1",
66-
"smile_v2",
67-
"stretch_v2",
68-
"stretch_v3",
69-
)
70-
LIMITS: Final[tuple[str, ...]] = (
71-
"setpoint",
72-
"lower_bound",
73-
"upper_bound",
74-
"resolution",
75-
)
76-
7764
HW_MODELS: Final[dict[str, str]] = {
7865
"143.1": "ThermoTouch",
7966
"159.2": "Adam",
@@ -111,9 +98,21 @@
11198
"070051": "Switch",
11299
"080029": "Switch",
113100
}
114-
101+
LEGACY_SMILES: Final[tuple[str, ...]] = (
102+
"smile_thermo_v1",
103+
"smile_v2",
104+
"stretch_v2",
105+
"stretch_v3",
106+
)
107+
LIMITS: Final[tuple[str, ...]] = (
108+
"setpoint",
109+
"lower_bound",
110+
"upper_bound",
111+
"resolution",
112+
)
115113
MAX_SETPOINT: Final[float] = 30.0
116114
MIN_SETPOINT: Final[float] = 4.0
115+
NONE: Final = "None"
117116
SPECIAL_FORMAT: Final[tuple[str, ...]] = (ENERGY_KILO_WATT_HOUR, VOLUME_CUBIC_METERS)
118117
SWITCH_GROUP_TYPES: Final[tuple[str, ...]] = ("switching", "report")
119118
ZONE_THERMOSTATS: Final[tuple[str, ...]] = (

plugwise/helper.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
DEFAULT_PW_MAX,
3030
DEFAULT_PW_MIN,
3131
DEVICE_MEASUREMENTS,
32+
DHW_SETPOINT,
3233
ENERGY_KILO_WATT_HOUR,
3334
ENERGY_WATT_HOUR,
3435
FAKE_APPL,
@@ -107,6 +108,8 @@ def check_model(name: str | None, vendor_name: str | None) -> str | None:
107108
def _get_actuator_functionalities(xml: etree, data: DeviceData) -> None:
108109
"""Helper-function for _get_appliance_data()."""
109110
for item in ACTIVE_ACTUATORS:
111+
if item == "max_dhw_temperature":
112+
continue
110113
temp_dict: ActuatorData = {}
111114
for key in LIMITS:
112115
locator = f'.//actuator_functionalities/thermostat_functionality[type="{item}"]/{key}'
@@ -119,9 +122,10 @@ def _get_actuator_functionalities(xml: etree, data: DeviceData) -> None:
119122
if temp_dict:
120123
# If domestic_hot_water_setpoint is present as actuator,
121124
# rename and remove as sensor
122-
if item == "domestic_hot_water_setpoint":
125+
if item == DHW_SETPOINT:
123126
item = "max_dhw_temperature"
124-
data.pop("domestic_hot_water_setpoint")
127+
if DHW_SETPOINT in data:
128+
data.pop(DHW_SETPOINT)
125129

126130
data[item] = temp_dict # type: ignore [literal-required]
127131

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "plugwise"
7-
version = "0.31.5"
7+
version = "0.31.6"
88
license = {file = "LICENSE"}
99
description = "Plugwise Smile (Adam/Anna/P1) and Stretch module for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)