Skip to content

Commit 77260f7

Browse files
authored
Merge pull request #402 from plugwise/improve-actuators
Improve handling of invalid actuator xml-data
2 parents 3d1cd83 + 77c28c7 commit 77260f7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Ongoing
4+
5+
- Improve handling of invalid actuator xml-data (partial solution for [HA Core issue #99372](https://github.com/home-assistant/core/issues/99372)
6+
37
## v0.32.3 Improve quality by extended testing, bugfix
48

59
- Testing: make it possible to emulate binary_sensors, climates, numbers, sensors, switches, etc., updating.

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)