Switch async_track_point_in_time to async_call_later in alarmdecoder (#99213)

This commit is contained in:
J. Nick Koston 2023-08-28 09:57:16 -05:00 committed by GitHub
parent f7a45e31c1
commit 4eb71a534f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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