mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
Fix Sonos diagnostics with offline device (#65393)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
3da60355a9
commit
c80d6810b3
@ -91,9 +91,13 @@ async def async_generate_media_info(
|
||||
payload[attrib] = getattr(speaker.media, attrib)
|
||||
|
||||
def poll_current_track_info():
|
||||
return speaker.soco.avTransport.GetPositionInfo(
|
||||
[("InstanceID", 0), ("Channel", "Master")]
|
||||
)
|
||||
try:
|
||||
return speaker.soco.avTransport.GetPositionInfo(
|
||||
[("InstanceID", 0), ("Channel", "Master")],
|
||||
timeout=3,
|
||||
)
|
||||
except OSError as ex:
|
||||
return f"Error retrieving: {ex}"
|
||||
|
||||
payload["current_track_poll"] = await hass.async_add_executor_job(
|
||||
poll_current_track_info
|
||||
|
Loading…
x
Reference in New Issue
Block a user