mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Adjust diagnostic return type in Sonos (#85585)
This commit is contained in:
parent
b64d14004a
commit
fa7d7415d7
@ -65,17 +65,17 @@ async def async_get_config_entry_diagnostics(
|
|||||||
|
|
||||||
async def async_get_device_diagnostics(
|
async def async_get_device_diagnostics(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, device: DeviceEntry
|
hass: HomeAssistant, config_entry: ConfigEntry, device: DeviceEntry
|
||||||
) -> dict[str, Any] | None:
|
) -> dict[str, Any]:
|
||||||
"""Return diagnostics for a device."""
|
"""Return diagnostics for a device."""
|
||||||
uid = next(
|
uid = next(
|
||||||
(identifier[1] for identifier in device.identifiers if identifier[0] == DOMAIN),
|
(identifier[1] for identifier in device.identifiers if identifier[0] == DOMAIN),
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
if uid is None:
|
if uid is None:
|
||||||
return None
|
return {}
|
||||||
|
|
||||||
if (speaker := hass.data[DATA_SONOS].discovered.get(uid)) is None:
|
if (speaker := hass.data[DATA_SONOS].discovered.get(uid)) is None:
|
||||||
return None
|
return {}
|
||||||
|
|
||||||
return await async_generate_speaker_info(hass, speaker)
|
return await async_generate_speaker_info(hass, speaker)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user