Explicitly pass in the config_entry in squeezebox coordinator (#138105)

explicitly pass in the config_entry in coordinator
This commit is contained in:
Michael 2025-02-09 18:59:20 +01:00 committed by GitHub
parent eebe182001
commit 0d0e751700
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -151,7 +151,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: SqueezeboxConfigEntry) -
else:
_LOGGER.debug("Adding new entity: %s", player)
player_coordinator = SqueezeBoxPlayerUpdateCoordinator(
hass, player, lms.uuid
hass, entry, player, lms.uuid
)
known_players.append(player.player_id)
async_dispatcher_send(

View File

@ -90,11 +90,20 @@ class LMSStatusDataUpdateCoordinator(DataUpdateCoordinator):
class SqueezeBoxPlayerUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"""Coordinator for Squeezebox players."""
def __init__(self, hass: HomeAssistant, player: Player, server_uuid: str) -> None:
config_entry: SqueezeboxConfigEntry
def __init__(
self,
hass: HomeAssistant,
config_entry: SqueezeboxConfigEntry,
player: Player,
server_uuid: str,
) -> None:
"""Initialize the coordinator."""
super().__init__(
hass,
_LOGGER,
config_entry=config_entry,
name=player.name,
update_interval=timedelta(seconds=PLAYER_UPDATE_INTERVAL),
always_update=True,