Skip to content

Commit fa63f44

Browse files
committed
Revert const-change, block unwanted locks
1 parent e97c508 commit fa63f44

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

plugwise/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@
399399
# Plug
400400
"electricity_consumed": {ATTR_UNIT_OF_MEASUREMENT: POWER_WATT},
401401
"electricity_produced": {ATTR_UNIT_OF_MEASUREMENT: POWER_WATT},
402+
"relay": {ATTR_UNIT_OF_MEASUREMENT: None},
402403
}
403404

404405
HEATER_CENTRAL_MEASUREMENTS = {

plugwise/helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,17 +568,18 @@ def appliance_data(self, dev_id):
568568

569569
data[name] = format_measure(measure, ENERGY_WATT_HOUR)
570570

571-
# Adam & Stretches: detect relay switch data
571+
# Adam & Stretches: find relay switch lock state
572572
actuator = "actuator_functionalities"
573573
func_type = "relay_functionality"
574574
if self.smile_type == "stretch" and self.smile_version[1].major == 2:
575575
actuator = "actuators"
576576
func_type = "relay"
577-
for item, name in {"lock": "lock", "state": "relay"}.items():
578-
locator = f".//{actuator}/{func_type}/{item}"
577+
appl_class = appliance.find("type").text
578+
if appl_class not in ["central_heating_pump", "valve_actuator"]:
579+
locator = f".//{actuator}/{func_type}/lock"
579580
if appliance.find(locator) is not None:
580581
measure = appliance.find(locator).text
581-
data[name] = format_measure(measure, None)
582+
data["lock"] = format_measure(measure, None)
582583

583584
# Fix for Adam + Anna: heating_state also present under Anna, remove
584585
if "temperature" in data:

0 commit comments

Comments
 (0)