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

This commit is contained in:
jjlawren
2022-07-27 03:01:44 -05:00
committed by GitHub
parent 5687150786
commit bbdce93291

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",