mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Explicitly pass in the config_entry in ld2410_ble coordinator (#138115)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
75cf47be2b
commit
9244e84326
@ -41,7 +41,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
ld2410_ble = LD2410BLE(ble_device)
|
ld2410_ble = LD2410BLE(ble_device)
|
||||||
|
|
||||||
coordinator = LD2410BLECoordinator(hass, ld2410_ble)
|
coordinator = LD2410BLECoordinator(hass, entry, ld2410_ble)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await ld2410_ble.initialise()
|
await ld2410_ble.initialise()
|
||||||
|
@ -6,6 +6,7 @@ import time
|
|||||||
|
|
||||||
from ld2410_ble import LD2410BLE, LD2410BLEState
|
from ld2410_ble import LD2410BLE, LD2410BLEState
|
||||||
|
|
||||||
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
@ -21,11 +22,16 @@ DEBOUNCE_SECONDS = 1.0
|
|||||||
class LD2410BLECoordinator(DataUpdateCoordinator[None]):
|
class LD2410BLECoordinator(DataUpdateCoordinator[None]):
|
||||||
"""Data coordinator for receiving LD2410B updates."""
|
"""Data coordinator for receiving LD2410B updates."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, ld2410_ble: LD2410BLE) -> None:
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
|
def __init__(
|
||||||
|
self, hass: HomeAssistant, config_entry: ConfigEntry, ld2410_ble: LD2410BLE
|
||||||
|
) -> None:
|
||||||
"""Initialise the coordinator."""
|
"""Initialise the coordinator."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
|
config_entry=config_entry,
|
||||||
name=DOMAIN,
|
name=DOMAIN,
|
||||||
)
|
)
|
||||||
self._ld2410_ble = ld2410_ble
|
self._ld2410_ble = ld2410_ble
|
||||||
|
Loading…
x
Reference in New Issue
Block a user