Skip to content

Commit

Permalink
async_dispatcher_send calls removed from non main loop threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ClusterM committed Jun 7, 2024
1 parent 206cc3a commit acb500d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/skykettle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CONF_FRIENDLY_NAME, CONF_MAC, CONF_PASSWORD,
CONF_SCAN_INTERVAL, Platform)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.entity import DeviceInfo

from .const import *
Expand Down Expand Up @@ -44,6 +44,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

async def poll(now, **kwargs) -> None:
await kettle.update()
await hass.async_add_executor_job(dispatcher_send, hass, DISPATCHER_UPDATE)
if hass.data[DOMAIN][DATA_WORKING]:
schedule_poll(timedelta(seconds=entry.data[CONF_SCAN_INTERVAL]))
else:
Expand Down

0 comments on commit acb500d

Please sign in to comment.