mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Switch async_track_point_in_time to async_call_later in alarmdecoder (#99213)
This commit is contained in:
parent
f7a45e31c1
commit
4eb71a534f
@ -16,8 +16,7 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.dispatcher import dispatcher_send
|
from homeassistant.helpers.dispatcher import dispatcher_send
|
||||||
from homeassistant.helpers.event import async_track_point_in_time
|
from homeassistant.helpers.event import async_call_later
|
||||||
from homeassistant.util import dt as dt_util
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_DEVICE_BAUD,
|
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)
|
await hass.async_add_executor_job(controller.open, baud)
|
||||||
except NoDeviceError:
|
except NoDeviceError:
|
||||||
_LOGGER.debug("Failed to connect. Retrying in 5 seconds")
|
_LOGGER.debug("Failed to connect. Retrying in 5 seconds")
|
||||||
async_track_point_in_time(
|
async_call_later(hass, timedelta(seconds=5), open_connection)
|
||||||
hass, open_connection, dt_util.utcnow() + timedelta(seconds=5)
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
_LOGGER.debug("Established a connection with the alarmdecoder")
|
_LOGGER.debug("Established a connection with the alarmdecoder")
|
||||||
hass.data[DOMAIN][entry.entry_id][DATA_RESTART] = True
|
hass.data[DOMAIN][entry.entry_id][DATA_RESTART] = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user