Fix lingering timer in buienradar (#91378)

This commit is contained in:
epenet
2023-04-16 14:20:54 +02:00
committed by GitHub
parent b0e0ada512
commit 3ff03eef46
4 changed files with 18 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ from homeassistant.const import (
CONF_NAME,
DEGREE,
PERCENTAGE,
Platform,
UnitOfIrradiance,
UnitOfLength,
UnitOfPrecipitationDepth,
@@ -47,7 +48,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import dt as dt_util
from .const import CONF_TIMEFRAME, DEFAULT_TIMEFRAME
from .const import CONF_TIMEFRAME, DEFAULT_TIMEFRAME, DOMAIN
from .util import BrData
_LOGGER = logging.getLogger(__name__)
@@ -684,6 +685,7 @@ async def async_setup_entry(
data = BrData(hass, coordinates, timeframe, entities)
# schedule the first update in 1 minute from now:
await data.schedule_update(1)
hass.data[DOMAIN][entry.entry_id][Platform.SENSOR] = data
class BrSensor(SensorEntity):