Skip to content

Commit

Permalink
Merge pull request #56 from chemelli74/patch-1
Browse files Browse the repository at this point in the history
Fix Non-thread-safe operation invoked
  • Loading branch information
elad-bar authored Nov 5, 2023
2 parents 33be6ab + e0dc69d commit c25c8dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/shinobi/managers/websockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import aiohttp
from aiohttp import ClientSession

from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import async_track_time_interval
Expand Down Expand Up @@ -536,6 +536,7 @@ def fire_event(self, trigger: str, data: dict):
else:
_LOGGER.info(f"Firing event {event_name}, Payload: {data}")

@callback
def _check_triggers(self, now):
if self._is_home_assistant:
self._hass.async_create_task(self._async_check_triggers(now))
Expand Down

0 comments on commit c25c8dd

Please sign in to comment.