Explicitly pass in the config_entry in enigma2 coordinator (#137739)
explicitly pass in the config_entry in coordinatorpull/137181/head
parent
88a2b2ab90
commit
1c7bf9f589
|
@ -1,12 +1,9 @@
|
|||
"""Support for Enigma2 devices."""
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from .coordinator import Enigma2UpdateCoordinator
|
||||
|
||||
type Enigma2ConfigEntry = ConfigEntry[Enigma2UpdateCoordinator]
|
||||
from .coordinator import Enigma2ConfigEntry, Enigma2UpdateCoordinator
|
||||
|
||||
PLATFORMS = [Platform.MEDIA_PLAYER]
|
||||
|
||||
|
@ -22,6 +19,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: Enigma2ConfigEntry) -> b
|
|||
return True
|
||||
|
||||
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
async def async_unload_entry(hass: HomeAssistant, entry: Enigma2ConfigEntry) -> bool:
|
||||
"""Unload a config entry."""
|
||||
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||
|
|
|
@ -30,18 +30,25 @@ from .const import CONF_SOURCE_BOUQUET, DOMAIN
|
|||
|
||||
LOGGER = logging.getLogger(__package__)
|
||||
|
||||
type Enigma2ConfigEntry = ConfigEntry[Enigma2UpdateCoordinator]
|
||||
|
||||
|
||||
class Enigma2UpdateCoordinator(DataUpdateCoordinator[OpenWebIfStatus]):
|
||||
"""The Enigma2 data update coordinator."""
|
||||
|
||||
config_entry: Enigma2ConfigEntry
|
||||
device: OpenWebIfDevice
|
||||
unique_id: str | None
|
||||
|
||||
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
def __init__(self, hass: HomeAssistant, config_entry: Enigma2ConfigEntry) -> None:
|
||||
"""Initialize the Enigma2 data update coordinator."""
|
||||
|
||||
super().__init__(
|
||||
hass, logger=LOGGER, name=DOMAIN, update_interval=DEFAULT_SCAN_INTERVAL
|
||||
hass,
|
||||
logger=LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=DEFAULT_SCAN_INTERVAL,
|
||||
)
|
||||
|
||||
base_url = URL.build(
|
||||
|
|
|
@ -18,8 +18,7 @@ from homeassistant.core import HomeAssistant, callback
|
|||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from . import Enigma2ConfigEntry
|
||||
from .coordinator import Enigma2UpdateCoordinator
|
||||
from .coordinator import Enigma2ConfigEntry, Enigma2UpdateCoordinator
|
||||
|
||||
ATTR_MEDIA_CURRENTLY_RECORDING = "media_currently_recording"
|
||||
ATTR_MEDIA_DESCRIPTION = "media_description"
|
||||
|
|
Loading…
Reference in New Issue