Skip to content

Commit 3314cc5

Browse files
committed
Improve handling of invalid actuator xml-data
Solution to home-assistant/core#99372
1 parent 3d1cd83 commit 3314cc5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

plugwise/helper.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,14 +948,18 @@ def _get_actuator_functionalities(
948948
if self._smile_legacy:
949949
continue
950950

951+
# When there is no updated_date-text, skip the actuator
952+
updated_date_location = f'.//actuator_functionalities/{functionality}[type="{item}"]/updated_date'
953+
if (
954+
updated_date_key := xml.find(updated_date_location)
955+
) is not None and updated_date_key.text is None:
956+
continue
957+
951958
for key in LIMITS:
952959
locator = (
953960
f'.//actuator_functionalities/{functionality}[type="{item}"]/{key}'
954961
)
955962
if (function := xml.find(locator)) is not None:
956-
if function.text == "nil":
957-
break
958-
959963
if key == "offset":
960964
# Add limits and resolution for temperature_offset,
961965
# not provided by Plugwise in the XML data

0 commit comments

Comments
 (0)