File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 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
404405HEATER_CENTRAL_MEASUREMENTS = {
Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments