1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-23 20:09:03 +00:00

Overwork Services/Discovery (#725)

* Update homeassistant.py

* Update validate.py

* Update exceptions.py

* Update services.py

* Update discovery.py

* fix gitignore

* Fix handling for discovery

* use object in ref

* lock down discovery API

* fix api

* Design

* Fix API

* fix lint

* fix

* Fix security layer

* add provide layer

* fix access

* change rating

* fix rights

* Fix API error handling

* raise error

* fix rights

* api

* fix handling

* fix

* debug

* debug json

* Fix validator

* fix error

* new url

* fix schema
This commit is contained in:
Pascal Vizeli
2018-09-29 19:49:08 +02:00
committed by GitHub
parent 4ef8c9d633
commit e5451973bd
22 changed files with 263 additions and 202 deletions

View File

@@ -13,6 +13,7 @@ from ..const import (
ATTR_REFRESH_TOKEN, CONTENT_TYPE_BINARY)
from ..coresys import CoreSysAttributes
from ..validate import NETWORK_PORT, DOCKER_IMAGE
from ..exceptions import APIError
_LOGGER = logging.getLogger(__name__)
@@ -94,7 +95,7 @@ class APIHomeAssistant(CoreSysAttributes):
"""Return resource information."""
stats = await self.sys_homeassistant.stats()
if not stats:
raise RuntimeError("No stats available")
raise APIError("No stats available")
return {
ATTR_CPU_PERCENT: stats.cpu_percent,
@@ -139,6 +140,6 @@ class APIHomeAssistant(CoreSysAttributes):
"""Check configuration of Home Assistant."""
result = await self.sys_homeassistant.check_config()
if not result.valid:
raise RuntimeError(result.log)
raise APIError(result.log)
return True