mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-12 11:46:31 +00:00
Add API support for new handling
This commit is contained in:
parent
0de3e9a233
commit
1a6f6085e6
@ -4,7 +4,6 @@ import hashlib
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
from aiohttp.web_exceptions import HTTPServiceUnavailable
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from voluptuous.humanize import humanize_error
|
from voluptuous.humanize import humanize_error
|
||||||
|
|
||||||
@ -41,9 +40,9 @@ def api_process(method):
|
|||||||
return api_return_ok(data=answer)
|
return api_return_ok(data=answer)
|
||||||
if isinstance(answer, web.Response):
|
if isinstance(answer, web.Response):
|
||||||
return answer
|
return answer
|
||||||
elif answer:
|
elif isinstance(answer, bool) and not answer:
|
||||||
return api_return_ok()
|
|
||||||
return api_return_error()
|
return api_return_error()
|
||||||
|
return api_return_ok()
|
||||||
|
|
||||||
return wrap_api
|
return wrap_api
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user