Clean up frontend services and events (#31654)

* Clean up frontend services and events

* Fix bug in core instead

* Add test that core works correctly with callback marked async funcs
This commit is contained in:
Paulus Schoutsen 2020-02-09 19:47:16 -08:00 committed by GitHub
parent 28eeed1db3
commit 12de3f1e47
4 changed files with 59 additions and 40 deletions

View file

@ -461,7 +461,9 @@ def async_register_admin_service(
if not user.is_admin:
raise Unauthorized(context=call.context)
await hass.async_add_job(service_func, call)
result = hass.async_add_job(service_func, call)
if result is not None:
await result
hass.services.async_register(domain, service, admin_handler, schema)