Skip to content

Commit e3e9861

Browse files
committed
Revert back to walrus, rearrange
1 parent 385ce74 commit e3e9861

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugwise/smile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ def __init__(
347347
async def connect(self) -> bool:
348348
"""Connect to Plugwise device and determine its name, type and version."""
349349
result = await self._request(DOMAIN_OBJECTS)
350-
vendor_names: list[etree] = result.findall("./module/vendor_name")
351-
vendor_models: list[etree] = result.findall("./module/vendor_model")
352350
# Work-around for Stretch fv 2.7.18
353-
if not vendor_names:
351+
if not (vendor_names := result.findall("./module/vendor_name")):
354352
result = await self._request(MODULES)
355353
vendor_names = result.findall("./module/vendor_name")
356354

357355
names: list[str] = []
358-
models: list[str] = []
359356
for name in vendor_names:
360357
names.append(name.text)
358+
359+
vendor_models = result.findall("./module/vendor_model")
360+
models: list[str] = []
361361
for model in vendor_models:
362362
models.append(model.text)
363363

0 commit comments

Comments
 (0)