mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Change to call_service async_stop non-blocking to allow service call finish (#15803)
* Call later sync_stop to allow service call finish * Change to use non-blocking service all for restart and stop
This commit is contained in:
parent
e4b2ae29bd
commit
12e69202f8
@ -519,8 +519,12 @@ def handle_call_service(hass, connection, msg):
|
||||
"""
|
||||
async def call_service_helper(msg):
|
||||
"""Call a service and fire complete message."""
|
||||
blocking = True
|
||||
if (msg['domain'] == 'homeassistant' and
|
||||
msg['service'] in ['restart', 'stop']):
|
||||
blocking = False
|
||||
await hass.services.async_call(
|
||||
msg['domain'], msg['service'], msg.get('service_data'), True,
|
||||
msg['domain'], msg['service'], msg.get('service_data'), blocking,
|
||||
connection.context(msg))
|
||||
connection.send_message_outside(result_message(msg['id']))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user