Skip to content

Commit

Permalink
Fix lingering timer in broadlink (#92179)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet committed Apr 28, 2023
1 parent a0cd0b3 commit 397a5ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions homeassistant/components/broadlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a Broadlink device from a config entry."""
data: BroadlinkData = hass.data[DOMAIN]

device = BroadlinkDevice(hass, entry)
if not await device.async_setup():
return False
if data.heartbeat is None:
data.heartbeat = BroadlinkHeartbeat(hass)
hass.async_create_task(data.heartbeat.async_setup())

device = BroadlinkDevice(hass, entry)
return await device.async_setup()
return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Expand Down

0 comments on commit 397a5ff

Please sign in to comment.