Switch lifx to use async_call_later (#99217)

This commit is contained in:
J. Nick Koston 2023-08-28 10:20:42 -05:00 committed by GitHub
parent ccb91e3676
commit 1bf7b4b2c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: