From 1bf7b4b2c7d47593407863ddcc75cb0b238491d6 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 28 Aug 2023 10:20:42 -0500 Subject: [PATCH] Switch lifx to use async_call_later (#99217) --- homeassistant/components/lifx/light.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/lifx/light.py b/homeassistant/components/lifx/light.py index 0e56155832f..e04e8afb3df 100644 --- a/homeassistant/components/lifx/light.py +++ b/homeassistant/components/lifx/light.py @@ -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: