Skip to content

Commit bcbfdc3

Browse files
committed
Improve 2
1 parent 6aa174a commit bcbfdc3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

plugwise/helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ def _appliance_measurements(
463463
continue
464464

465465
if new_name := getattr(attrs, ATTR_NAME, None):
466+
old_measurement = measurement
466467
measurement = new_name
467468

468469
match measurement:
@@ -471,6 +472,8 @@ def _appliance_measurements(
471472
case "select_dhw_mode":
472473
if self._dhw_allowed_modes:
473474
data["select_dhw_mode"] = appl_p_loc.text
475+
if old_measurement == "domestic_hot_water_comfort_mode":
476+
data["select_dhw_mode"] = "comfort" if appl_p_loc.text == "on" else "off"
474477

475478
common_match_cases(measurement, attrs, appl_p_loc, data)
476479

@@ -499,7 +502,6 @@ def _get_toggle_state(
499502
self._count += 1
500503
case "domestic_hot_water_comfort_mode":
501504
self._dhw_allowed_modes = ["comfort", "off"]
502-
# data["select_dhw_mode"] = "comfort" if state.text == "on" else "off"
503505

504506
def _get_plugwise_notifications(self) -> None:
505507
"""Collect the Plugwise notifications."""

0 commit comments

Comments
 (0)