Improve devialet coordinator typing (#104707)
parent
953a212dd6
commit
0a13968209
|
@ -14,7 +14,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
SCAN_INTERVAL = timedelta(seconds=5)
|
||||
|
||||
|
||||
class DevialetCoordinator(DataUpdateCoordinator):
|
||||
class DevialetCoordinator(DataUpdateCoordinator[None]):
|
||||
"""Devialet update coordinator."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, client: DevialetApi) -> None:
|
||||
|
@ -27,6 +27,6 @@ class DevialetCoordinator(DataUpdateCoordinator):
|
|||
)
|
||||
self.client = client
|
||||
|
||||
async def _async_update_data(self):
|
||||
async def _async_update_data(self) -> None:
|
||||
"""Fetch data from API endpoint."""
|
||||
await self.client.async_update()
|
||||
|
|
|
@ -46,13 +46,15 @@ async def async_setup_entry(
|
|||
async_add_entities([DevialetMediaPlayerEntity(coordinator, entry)])
|
||||
|
||||
|
||||
class DevialetMediaPlayerEntity(CoordinatorEntity, MediaPlayerEntity):
|
||||
class DevialetMediaPlayerEntity(
|
||||
CoordinatorEntity[DevialetCoordinator], MediaPlayerEntity
|
||||
):
|
||||
"""Devialet media player."""
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = None
|
||||
|
||||
def __init__(self, coordinator, entry: ConfigEntry) -> None:
|
||||
def __init__(self, coordinator: DevialetCoordinator, entry: ConfigEntry) -> None:
|
||||
"""Initialize the Devialet device."""
|
||||
self.coordinator = coordinator
|
||||
super().__init__(coordinator)
|
||||
|
|
Loading…
Reference in New Issue