Fix vanished checks on old Sonos firmware (#65477)

pull/65534/head
jjlawren 2022-02-03 06:22:34 -06:00 committed by GitHub
parent 69a004a2f6
commit 770707f487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -701,7 +701,7 @@ class SonosSpeaker:
"""Handle callback for topology change event."""
if xml := event.variables.get("zone_group_state"):
zgs = ET.fromstring(xml)
for vanished_device in zgs.find("VanishedDevices"):
for vanished_device in zgs.find("VanishedDevices") or []:
if (reason := vanished_device.get("Reason")) != "sleeping":
_LOGGER.debug(
"Ignoring %s marked %s as vanished with reason: %s",