Switch lifx to use async_call_later (#99217)
This commit is contained in:
parent
ccb91e3676
commit
1bf7b4b2c7
1 changed files with 3 additions and 4 deletions
|
@ -8,7 +8,6 @@ from typing import Any
|
|||
import aiolifx_effects as aiolifx_effects_module
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import util
|
||||
from homeassistant.components.light import (
|
||||
ATTR_EFFECT,
|
||||
ATTR_TRANSITION,
|
||||
|
@ -24,7 +23,7 @@ from homeassistant.exceptions import HomeAssistantError
|
|||
from homeassistant.helpers import entity_platform
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.event import async_track_point_in_utc_time
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
|
||||
from .const import (
|
||||
_LOGGER,
|
||||
|
@ -187,10 +186,10 @@ class LIFXLight(LIFXEntity, LightEntity):
|
|||
"""Refresh the state."""
|
||||
await self.coordinator.async_refresh()
|
||||
|
||||
self.postponed_update = async_track_point_in_utc_time(
|
||||
self.postponed_update = async_call_later(
|
||||
self.hass,
|
||||
timedelta(milliseconds=when),
|
||||
_async_refresh,
|
||||
util.dt.utcnow() + timedelta(milliseconds=when),
|
||||
)
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
|
|
Loading…
Add table
Reference in a new issue