mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-27 11:06:32 +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):
|
||||
"""Send a supervisor/event command."""
|
||||
if self.sys_core.state not in CLOSING_STATES:
|
||||
self.sys_loop.call_soon(
|
||||
self.sys_loop.create_task,
|
||||
self.async_supervisor_update_event(key, data),
|
||||
)
|
||||
if self.sys_core.state in CLOSING_STATES:
|
||||
return
|
||||
self.sys_create_task(self.async_supervisor_update_event(key, data))
|
||||
|
||||
def send_command(self, message: Dict[str, Any]):
|
||||
"""Send a supervisor/event command."""
|
||||
if self.sys_core.state not in CLOSING_STATES:
|
||||
self.sys_loop.call_soon(
|
||||
self.sys_loop.create_task, self.async_send_command(message)
|
||||
)
|
||||
if self.sys_core.state in CLOSING_STATES:
|
||||
return
|
||||
self.sys_create_task(self.async_send_command(message))
|
||||
|
Loading…
x
Reference in New Issue
Block a user