Add type to coordinator for Squeezebox (#149087)

This commit is contained in:
peteS-UK 2025-07-19 19:39:22 +01:00 committed by GitHub
parent d266b6f6ab
commit be644ca96e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,7 @@ from .const import (
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
class LMSStatusDataUpdateCoordinator(DataUpdateCoordinator): class LMSStatusDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"""LMS Status custom coordinator.""" """LMS Status custom coordinator."""
config_entry: SqueezeboxConfigEntry config_entry: SqueezeboxConfigEntry
@ -59,13 +59,13 @@ class LMSStatusDataUpdateCoordinator(DataUpdateCoordinator):
else: else:
_LOGGER.warning("Can't query server capabilities %s", self.lms.name) _LOGGER.warning("Can't query server capabilities %s", self.lms.name)
async def _async_update_data(self) -> dict: async def _async_update_data(self) -> dict[str, Any]:
"""Fetch data from LMS status call. """Fetch data from LMS status call.
Then we process only a subset to make then nice for HA Then we process only a subset to make then nice for HA
""" """
async with timeout(STATUS_API_TIMEOUT): async with timeout(STATUS_API_TIMEOUT):
data: dict | None = await self.lms.async_prepared_status() data: dict[str, Any] | None = await self.lms.async_prepared_status()
if not data: if not data:
raise UpdateFailed( raise UpdateFailed(