Explicitly pass in the config_entry in fjaraskupan coordinator (#137825)
explicitly pass in the config_entry in coordinatorpull/137950/head
parent
1522f7b3a8
commit
af87e36048
|
@ -76,7 +76,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
)
|
)
|
||||||
|
|
||||||
coordinator: FjaraskupanCoordinator = FjaraskupanCoordinator(
|
coordinator: FjaraskupanCoordinator = FjaraskupanCoordinator(
|
||||||
hass, device, device_info
|
hass, entry, device, device_info
|
||||||
)
|
)
|
||||||
coordinator.detection_callback(service_info)
|
coordinator.detection_callback(service_info)
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ from homeassistant.components.bluetooth import (
|
||||||
async_address_present,
|
async_address_present,
|
||||||
async_ble_device_from_address,
|
async_ble_device_from_address,
|
||||||
)
|
)
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.device_registry import DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
|
@ -64,8 +65,14 @@ class UnableToConnect(HomeAssistantError):
|
||||||
class FjaraskupanCoordinator(DataUpdateCoordinator[State]):
|
class FjaraskupanCoordinator(DataUpdateCoordinator[State]):
|
||||||
"""Update coordinator for each device."""
|
"""Update coordinator for each device."""
|
||||||
|
|
||||||
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, hass: HomeAssistant, device: Device, device_info: DeviceInfo
|
self,
|
||||||
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
device: Device,
|
||||||
|
device_info: DeviceInfo,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the coordinator."""
|
"""Initialize the coordinator."""
|
||||||
self.device = device
|
self.device = device
|
||||||
|
@ -73,7 +80,11 @@ class FjaraskupanCoordinator(DataUpdateCoordinator[State]):
|
||||||
self._refresh_was_scheduled = False
|
self._refresh_was_scheduled = False
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass, _LOGGER, name="Fjäråskupan", update_interval=timedelta(seconds=120)
|
hass,
|
||||||
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
|
name="Fjäråskupan",
|
||||||
|
update_interval=timedelta(seconds=120),
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _async_refresh(
|
async def _async_refresh(
|
||||||
|
|
Loading…
Reference in New Issue