Add event statistics to Sonos diagnostics (#64845)

This commit is contained in:
jjlawren 2022-01-25 02:52:40 -06:00 committed by GitHub
parent 5d7d652237
commit ec88897d04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 138 additions and 47 deletions

View file

@ -192,6 +192,8 @@ class SonosDiscoveryManager:
return None
async def _async_stop_event_listener(self, event: Event | None = None) -> None:
for speaker in self.data.discovered.values():
speaker.event_stats.log_report()
await asyncio.gather(
*(speaker.async_offline() for speaker in self.data.discovered.values())
)