Add ZoneGroupState statistics to Sonos diagnostics (#73848)
parent
54d04d233b
commit
8d66623036
|
@ -190,6 +190,14 @@ class SonosDiscoveryManager:
|
||||||
for speaker in self.data.discovered.values():
|
for speaker in self.data.discovered.values():
|
||||||
speaker.activity_stats.log_report()
|
speaker.activity_stats.log_report()
|
||||||
speaker.event_stats.log_report()
|
speaker.event_stats.log_report()
|
||||||
|
if zgs := next(
|
||||||
|
speaker.soco.zone_group_state for speaker in self.data.discovered.values()
|
||||||
|
):
|
||||||
|
_LOGGER.debug(
|
||||||
|
"ZoneGroupState stats: (%s/%s) processed",
|
||||||
|
zgs.processed_count,
|
||||||
|
zgs.total_requests,
|
||||||
|
)
|
||||||
await asyncio.gather(
|
await asyncio.gather(
|
||||||
*(speaker.async_offline() for speaker in self.data.discovered.values())
|
*(speaker.async_offline() for speaker in self.data.discovered.values())
|
||||||
)
|
)
|
||||||
|
|
|
@ -136,4 +136,8 @@ async def async_generate_speaker_info(
|
||||||
payload["media"] = await async_generate_media_info(hass, speaker)
|
payload["media"] = await async_generate_media_info(hass, speaker)
|
||||||
payload["activity_stats"] = speaker.activity_stats.report()
|
payload["activity_stats"] = speaker.activity_stats.report()
|
||||||
payload["event_stats"] = speaker.event_stats.report()
|
payload["event_stats"] = speaker.event_stats.report()
|
||||||
|
payload["zone_group_state_stats"] = {
|
||||||
|
"processed": speaker.soco.zone_group_state.processed_count,
|
||||||
|
"total_requests": speaker.soco.zone_group_state.total_requests,
|
||||||
|
}
|
||||||
return payload
|
return payload
|
||||||
|
|
Loading…
Reference in New Issue