summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEvgeny Sorokin <me@ch1p.io>2024-01-16 03:31:55 +0300
committerEvgeny Sorokin <me@ch1p.io>2024-01-16 03:32:07 +0300
commit8a89dd77be03ca8eb9cdc378ba8e912292494fa9 (patch)
treef2d04c1a6ce8b2731febbf6b66f6127057f9477d /include
parentde56aa3ae916ac0d51e503648fae8f3fa2d97951 (diff)
inverter page
Diffstat (limited to 'include')
-rw-r--r--include/py/homekit/http/http.py5
-rw-r--r--include/py/homekit/inverter/config.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/include/py/homekit/http/http.py b/include/py/homekit/http/http.py
index 9b76d9a..82c5aae 100644
--- a/include/py/homekit/http/http.py
+++ b/include/py/homekit/http/http.py
@@ -3,7 +3,7 @@ import asyncio
from enum import Enum
from aiohttp import web
-from aiohttp.web import Response
+from aiohttp.web import Response, HTTPFound
from aiohttp.web_exceptions import HTTPNotFound
from ..util import stringify, format_tb, Addr
@@ -21,6 +21,9 @@ async def errors_handler_middleware(request, handler):
except HTTPNotFound:
return web.json_response({'error': 'not found'}, status=404)
+ except HTTPFound as exc:
+ raise exc
+
except Exception as exc:
_logger.exception(exc)
data = {
diff --git a/include/py/homekit/inverter/config.py b/include/py/homekit/inverter/config.py
index e284dfe..694ddae 100644
--- a/include/py/homekit/inverter/config.py
+++ b/include/py/homekit/inverter/config.py
@@ -8,6 +8,6 @@ class InverterdConfig(ConfigUnit):
@classmethod
def schema(cls) -> Optional[dict]:
return {
- 'remote_addr': {'type': 'string'},
- 'local_addr': {'type': 'string'},
+ 'remote_addr': cls._addr_schema(required=True),
+ 'local_addr': cls._addr_schema(required=True),
} \ No newline at end of file