mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Explicitly pass in the config_entry in romy coordinator (#137967)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
2ef4e75014
commit
c47a97a4f0
@ -17,7 +17,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
|
|||||||
config_entry.data[CONF_HOST], config_entry.data.get(CONF_PASSWORD, "")
|
config_entry.data[CONF_HOST], config_entry.data.get(CONF_PASSWORD, "")
|
||||||
)
|
)
|
||||||
|
|
||||||
coordinator = RomyVacuumCoordinator(hass, new_romy)
|
coordinator = RomyVacuumCoordinator(hass, config_entry, new_romy)
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = coordinator
|
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = coordinator
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from romy import RomyRobot
|
from romy import RomyRobot
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
@ -11,9 +12,19 @@ from .const import DOMAIN, LOGGER, UPDATE_INTERVAL
|
|||||||
class RomyVacuumCoordinator(DataUpdateCoordinator[None]):
|
class RomyVacuumCoordinator(DataUpdateCoordinator[None]):
|
||||||
"""ROMY Vacuum Coordinator."""
|
"""ROMY Vacuum Coordinator."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, romy: RomyRobot) -> None:
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, hass: HomeAssistant, config_entry: ConfigEntry, romy: RomyRobot
|
||||||
|
) -> None:
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
super().__init__(hass, LOGGER, name=DOMAIN, update_interval=UPDATE_INTERVAL)
|
super().__init__(
|
||||||
|
hass,
|
||||||
|
LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
|
name=DOMAIN,
|
||||||
|
update_interval=UPDATE_INTERVAL,
|
||||||
|
)
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self.romy = romy
|
self.romy = romy
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user