mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Address jellyfin sensor feedback (#80222)
This commit is contained in:
parent
265e2741e7
commit
ce35812937
@ -52,7 +52,6 @@ class JellyfinDataUpdateCoordinator(DataUpdateCoordinator[JellyfinDataT]):
|
|||||||
@abstractmethod
|
@abstractmethod
|
||||||
async def _fetch_data(self) -> JellyfinDataT:
|
async def _fetch_data(self) -> JellyfinDataT:
|
||||||
"""Fetch the actual data."""
|
"""Fetch the actual data."""
|
||||||
raise NotImplementedError
|
|
||||||
|
|
||||||
|
|
||||||
class SessionsDataUpdateCoordinator(
|
class SessionsDataUpdateCoordinator(
|
||||||
@ -60,10 +59,14 @@ class SessionsDataUpdateCoordinator(
|
|||||||
):
|
):
|
||||||
"""Sessions update coordinator for Jellyfin."""
|
"""Sessions update coordinator for Jellyfin."""
|
||||||
|
|
||||||
async def _fetch_data(self) -> dict:
|
async def _fetch_data(self) -> dict[str, dict[str, Any]]:
|
||||||
"""Fetch the data."""
|
"""Fetch the data."""
|
||||||
sessions = await self.hass.async_add_executor_job(
|
sessions = await self.hass.async_add_executor_job(
|
||||||
self.api_client.jellyfin.sessions
|
self.api_client.jellyfin.sessions
|
||||||
)
|
)
|
||||||
|
|
||||||
return {session["Id"]: session for session in sessions}
|
sessions_by_id: dict[str, Any] = {
|
||||||
|
session["Id"]: session for session in sessions
|
||||||
|
}
|
||||||
|
|
||||||
|
return sessions_by_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user