mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-10-22 10:09:36 +00:00

* Support armv7 and first abstraction * Change layout * Add more type hints * Fix imports * Update * move forward * add tests * fix type * fix lint & tests * fix tests * Fix unittests * Fix create folder * cleanup * Fix import order * cleanup loop parameter * cleanup init function * Allow changeable image name * fix setup * Fix load of arch * Fix lint * Add typing * fix init * fix hassos cli problem & stick on supervisor arch * address comments * cleanup * Fix image selfheal * Add comment * update uvloop * remove uvloop * fix tagging * Fix install name * Fix validate build config * Abstract image_name from system cache
29 lines
985 B
Python
29 lines
985 B
Python
"""Init file for Hass.io info RESTful API."""
|
|
import logging
|
|
|
|
from ..const import (ATTR_ARCH, ATTR_CHANNEL, ATTR_HASSOS, ATTR_HOMEASSISTANT,
|
|
ATTR_HOSTNAME, ATTR_MACHINE, ATTR_SUPERVISOR,
|
|
ATTR_SUPPORTED_ARCH)
|
|
from ..coresys import CoreSysAttributes
|
|
from .utils import api_process
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
class APIInfo(CoreSysAttributes):
|
|
"""Handle RESTful API for info functions."""
|
|
|
|
@api_process
|
|
async def info(self, request):
|
|
"""Show system info."""
|
|
return {
|
|
ATTR_SUPERVISOR: self.sys_supervisor.version,
|
|
ATTR_HOMEASSISTANT: self.sys_homeassistant.version,
|
|
ATTR_HASSOS: self.sys_hassos.version,
|
|
ATTR_HOSTNAME: self.sys_host.info.hostname,
|
|
ATTR_MACHINE: self.sys_machine,
|
|
ATTR_ARCH: self.sys_arch.default,
|
|
ATTR_SUPPORTED_ARCH: self.sys_arch.supported,
|
|
ATTR_CHANNEL: self.sys_updater.channel,
|
|
}
|