mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +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(
|
||||
hass: HomeAssistant, config_entry: ConfigEntry, device: DeviceEntry
|
||||
) -> dict[str, Any] | None:
|
||||
) -> dict[str, Any]:
|
||||
"""Return diagnostics for a device."""
|
||||
uid = next(
|
||||
(identifier[1] for identifier in device.identifiers if identifier[0] == DOMAIN),
|
||||
None,
|
||||
)
|
||||
if uid is None:
|
||||
return None
|
||||
return {}
|
||||
|
||||
if (speaker := hass.data[DATA_SONOS].discovered.get(uid)) is None:
|
||||
return None
|
||||
return {}
|
||||
|
||||
return await async_generate_speaker_info(hass, speaker)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user