Fix error on shutdown when no Sonos devices available (#75798)

pull/75807/head
jjlawren 2022-07-27 03:01:44 -05:00 committed by GitHub
parent 5687150786
commit bbdce93291
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ class SonosDiscoveryManager:
speaker.activity_stats.log_report()
speaker.event_stats.log_report()
if zgs := next(
speaker.soco.zone_group_state for speaker in self.data.discovered.values()
(
speaker.soco.zone_group_state
for speaker in self.data.discovered.values()
),
None,
):
_LOGGER.debug(
"ZoneGroupState stats: (%s/%s) processed",