Switch async_track_point_in_time to async_call_later in alarmdecoder (#99213)
This commit is contained in:
parent
f7a45e31c1
commit
4eb71a534f
1 changed files with 2 additions and 5 deletions
|
@ -16,8 +16,7 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.dispatcher import dispatcher_send
|
||||
from homeassistant.helpers.event import async_track_point_in_time
|
||||
from homeassistant.util import dt as dt_util
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
|
||||
from .const import (
|
||||
CONF_DEVICE_BAUD,
|
||||
|
@ -66,9 +65,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
await hass.async_add_executor_job(controller.open, baud)
|
||||
except NoDeviceError:
|
||||
_LOGGER.debug("Failed to connect. Retrying in 5 seconds")
|
||||
async_track_point_in_time(
|
||||
hass, open_connection, dt_util.utcnow() + timedelta(seconds=5)
|
||||
)
|
||||
async_call_later(hass, timedelta(seconds=5), open_connection)
|
||||
return
|
||||
_LOGGER.debug("Established a connection with the alarmdecoder")
|
||||
hass.data[DOMAIN][entry.entry_id][DATA_RESTART] = True
|
||||
|
|
Loading…
Add table
Reference in a new issue