Skip to content

Commit fd671b7

Browse files
committed
Add detection of lock-state, change detection of relay-state
1 parent 01b3872 commit fd671b7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

plugwise/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@
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},
403402
}
404403

405404
HEATER_CENTRAL_MEASUREMENTS = {

plugwise/helper.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,12 @@ def appliance_data(self, dev_id):
568568

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

571+
for item, name in {"lock": "lock", "state": "relay"}.items():
572+
locator = f'.//actuator_functionalities/relay_functionality/{item}'
573+
if appliance.find(locator) is not None:
574+
measure = appliance.find(locator).text
575+
data[name] = measure
576+
571577
# Fix for Adam + Anna: heating_state also present under Anna, remove
572578
if "temperature" in data:
573579
data.pop("heating_state", None)

0 commit comments

Comments
 (0)