mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-10-18 16:19:38 +00:00

* Change API for new UI * Update API.md * Update validate.py * Update addon.py * Update API.md * Update addons.py * fix lint * Update security.py * Update version.py * Update security.py * Update security.py
27 lines
804 B
Python
27 lines
804 B
Python
"""Init file for Hass.io version RESTful API."""
|
|
import logging
|
|
|
|
from .utils import api_process
|
|
from ..const import (
|
|
ATTR_HOMEASSISTANT, ATTR_SUPERVISOR, ATTR_MACHINE, ATTR_ARCH, ATTR_HASSOS,
|
|
ATTR_CHANNEL)
|
|
from ..coresys import CoreSysAttributes
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
class APIVersion(CoreSysAttributes):
|
|
"""Handle RESTful API for version functions."""
|
|
|
|
@api_process
|
|
async def info(self, request):
|
|
"""Show version info."""
|
|
return {
|
|
ATTR_SUPERVISOR: self.sys_supervisor.version,
|
|
ATTR_HOMEASSISTANT: self.sys_homeassistant.version,
|
|
ATTR_HASSOS: self.sys_hassos.version,
|
|
ATTR_MACHINE: self.sys_machine,
|
|
ATTR_ARCH: self.sys_arch,
|
|
ATTR_CHANNEL: self.sys_updater.channel,
|
|
}
|