mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Explicitly pass in the config_entry in husqvarna_automower_ble coordinator (#138150)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
1dbd23eae1
commit
8c27a75d6b
@ -45,7 +45,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
model = await mower.get_model()
|
||||
LOGGER.debug("Connected to Automower: %s", model)
|
||||
|
||||
coordinator = HusqvarnaCoordinator(hass, mower, address, channel_id, model)
|
||||
coordinator = HusqvarnaCoordinator(hass, entry, mower, address, channel_id, model)
|
||||
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
entry.runtime_data = coordinator
|
||||
|
@ -9,6 +9,7 @@ from bleak import BleakError
|
||||
from bleak_retry_connector import close_stale_connections_by_address
|
||||
|
||||
from homeassistant.components import bluetooth
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
||||
@ -20,9 +21,12 @@ SCAN_INTERVAL = timedelta(seconds=60)
|
||||
class HusqvarnaCoordinator(DataUpdateCoordinator[dict[str, bytes]]):
|
||||
"""Class to manage fetching data."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
mower: Mower,
|
||||
address: str,
|
||||
channel_id: str,
|
||||
@ -32,6 +36,7 @@ class HusqvarnaCoordinator(DataUpdateCoordinator[dict[str, bytes]]):
|
||||
super().__init__(
|
||||
hass=hass,
|
||||
logger=LOGGER,
|
||||
config_entry=config_entry,
|
||||
name=DOMAIN,
|
||||
update_interval=SCAN_INTERVAL,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user