Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Non-thread-safe operation invoked #56

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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