Skip to content

Commit 19be354

Browse files
committed
Add _findall() function
1 parent ab8ee50 commit 19be354

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugwise/helper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ def _find(xml_in: etree, locator: str) -> etree:
8282
raise XMLDataMissingError
8383

8484

85+
def _findall(xml_in: etree, locator: str) -> list[etree]:
86+
"""Helper-function for use of etree.findall()."""
87+
if xml_in is not None:
88+
return xml_in.findall(locator)
89+
90+
LOGGER.error("XML data unexpectedly not found, processing stopped!")
91+
raise XMLDataMissingError
92+
93+
8594
def update_helper(
8695
data: DeviceDataPoints,
8796
devices: dict[str, DeviceData],

0 commit comments

Comments
 (0)