From 1a6f6085e63c6f93f9d743d1aefc2898d14a8d54 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 22 Apr 2018 10:15:07 +0200 Subject: [PATCH] Add API support for new handling --- hassio/api/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hassio/api/utils.py b/hassio/api/utils.py index 87d6f44e8..ce71d9ec1 100644 --- a/hassio/api/utils.py +++ b/hassio/api/utils.py @@ -4,7 +4,6 @@ import hashlib import logging from aiohttp import web -from aiohttp.web_exceptions import HTTPServiceUnavailable import voluptuous as vol from voluptuous.humanize import humanize_error @@ -41,9 +40,9 @@ def api_process(method): return api_return_ok(data=answer) if isinstance(answer, web.Response): return answer - elif answer: - return api_return_ok() - return api_return_error() + elif isinstance(answer, bool) and not answer: + return api_return_error() + return api_return_ok() return wrap_api