mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Switch w800rf32 to use async_call_later (#99214)
This commit is contained in:
parent
4eb71a534f
commit
6c16d89c1d
@ -17,7 +17,6 @@ from homeassistant.helpers import config_validation as cv, event as evt
|
|||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from . import W800RF32_DEVICE
|
from . import W800RF32_DEVICE
|
||||||
|
|
||||||
@ -127,8 +126,8 @@ class W800rf32BinarySensor(BinarySensorEntity):
|
|||||||
self.update_state(is_on)
|
self.update_state(is_on)
|
||||||
|
|
||||||
if self.is_on and self._off_delay is not None and self._delay_listener is None:
|
if self.is_on and self._off_delay is not None and self._delay_listener is None:
|
||||||
self._delay_listener = evt.async_track_point_in_time(
|
self._delay_listener = evt.async_call_later(
|
||||||
self.hass, self._off_delay_listener, dt_util.utcnow() + self._off_delay
|
self.hass, self._off_delay, self._off_delay_listener
|
||||||
)
|
)
|
||||||
|
|
||||||
def update_state(self, state):
|
def update_state(self, state):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user