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
pull/15857/head
Jason Hu 2018-08-06 01:25:37 -07:00 committed by Paulus Schoutsen
parent e4b2ae29bd
commit 12e69202f8
1 changed files with 5 additions and 1 deletions

View File

@ -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']))