mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 19:16:29 +00:00
Remove not needed call_soon (#2606)
This commit is contained in:
parent
6b7d437b00
commit
2de175e181
@ -153,15 +153,12 @@ class HomeAssistantWebSocket(CoreSysAttributes):
|
|||||||
|
|
||||||
def supervisor_update_event(self, key: str, data: Optional[Dict[str, Any]] = None):
|
def supervisor_update_event(self, key: str, data: Optional[Dict[str, Any]] = None):
|
||||||
"""Send a supervisor/event command."""
|
"""Send a supervisor/event command."""
|
||||||
if self.sys_core.state not in CLOSING_STATES:
|
if self.sys_core.state in CLOSING_STATES:
|
||||||
self.sys_loop.call_soon(
|
return
|
||||||
self.sys_loop.create_task,
|
self.sys_create_task(self.async_supervisor_update_event(key, data))
|
||||||
self.async_supervisor_update_event(key, data),
|
|
||||||
)
|
|
||||||
|
|
||||||
def send_command(self, message: Dict[str, Any]):
|
def send_command(self, message: Dict[str, Any]):
|
||||||
"""Send a supervisor/event command."""
|
"""Send a supervisor/event command."""
|
||||||
if self.sys_core.state not in CLOSING_STATES:
|
if self.sys_core.state in CLOSING_STATES:
|
||||||
self.sys_loop.call_soon(
|
return
|
||||||
self.sys_loop.create_task, self.async_send_command(message)
|
self.sys_create_task(self.async_send_command(message))
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user