mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
turn service call handler into coroutine (#10576)
This commit is contained in:
parent
0b4de54725
commit
8d91de877a
@ -207,7 +207,7 @@ class Configurator(object):
|
|||||||
|
|
||||||
self.hass.bus.async_listen_once(EVENT_TIME_CHANGED, deferred_remove)
|
self.hass.bus.async_listen_once(EVENT_TIME_CHANGED, deferred_remove)
|
||||||
|
|
||||||
@async_callback
|
@asyncio.coroutine
|
||||||
def async_handle_service_call(self, call):
|
def async_handle_service_call(self, call):
|
||||||
"""Handle a configure service call."""
|
"""Handle a configure service call."""
|
||||||
request_id = call.data.get(ATTR_CONFIGURE_ID)
|
request_id = call.data.get(ATTR_CONFIGURE_ID)
|
||||||
@ -220,7 +220,8 @@ class Configurator(object):
|
|||||||
|
|
||||||
# field validation goes here?
|
# field validation goes here?
|
||||||
if callback:
|
if callback:
|
||||||
self.hass.async_add_job(callback, call.data.get(ATTR_FIELDS, {}))
|
yield from self.hass.async_add_job(callback,
|
||||||
|
call.data.get(ATTR_FIELDS, {}))
|
||||||
|
|
||||||
def _generate_unique_id(self):
|
def _generate_unique_id(self):
|
||||||
"""Generate a unique configurator ID."""
|
"""Generate a unique configurator ID."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user