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:
parent
28eeed1db3
commit
12de3f1e47
4 changed files with 59 additions and 40 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue