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 stoppull/15857/head
parent
e4b2ae29bd
commit
12e69202f8
|
@ -519,8 +519,12 @@ def handle_call_service(hass, connection, msg):
|
||||||
"""
|
"""
|
||||||
async def call_service_helper(msg):
|
async def call_service_helper(msg):
|
||||||
"""Call a service and fire complete message."""
|
"""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(
|
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.context(msg))
|
||||||
connection.send_message_outside(result_message(msg['id']))
|
connection.send_message_outside(result_message(msg['id']))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue