mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-14 12:46:32 +00:00
Add update info to info call
This commit is contained in:
parent
84d428e7d4
commit
3e7f0a82c0
@ -62,6 +62,13 @@ On success
|
|||||||
|
|
||||||
- `/supervisor/info`
|
- `/supervisor/info`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": INSTALL_VERSION,
|
||||||
|
"current": CURRENT_VERSION
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- `/supervisor/update`
|
- `/supervisor/update`
|
||||||
Payload: {'version': '0.XX'}
|
Payload: {'version': '0.XX'}
|
||||||
If version is None it read last version from server.
|
If version is None it read last version from server.
|
||||||
@ -72,6 +79,8 @@ If version is None it read last version from server.
|
|||||||
|
|
||||||
- `/host/info`
|
- `/host/info`
|
||||||
|
|
||||||
|
See HostControll info command.
|
||||||
|
|
||||||
- `/host/update`
|
- `/host/update`
|
||||||
On some device we support host upates. Like ResinOS.
|
On some device we support host upates. Like ResinOS.
|
||||||
|
|
||||||
@ -86,6 +95,13 @@ Payload: {'hostname': '', 'mode': 'dhcp|fixed', 'ssid': '', 'ip': '', 'netmask':
|
|||||||
|
|
||||||
- `/homeassistant/info`
|
- `/homeassistant/info`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": INSTALL_VERSION,
|
||||||
|
"current": CURRENT_VERSION
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
- `/homeassistant/update`
|
- `/homeassistant/update`
|
||||||
Payload: {'version': '0.XX.Y'}
|
Payload: {'version': '0.XX.Y'}
|
||||||
If version is None it read last version from server.
|
If version is None it read last version from server.
|
||||||
|
@ -3,7 +3,7 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .util import api_process, json_loads
|
from .util import api_process, json_loads
|
||||||
from ..const import ATTR_VERSION
|
from ..const import ATTR_VERSION, ATTR_CURRENT
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ class APIHomeAssistant(object):
|
|||||||
"""Return host information."""
|
"""Return host information."""
|
||||||
info = {
|
info = {
|
||||||
ATTR_VERSION: self.dock_hass.version,
|
ATTR_VERSION: self.dock_hass.version,
|
||||||
|
ATTR_CURRENT: self.config.current_homeassistant,
|
||||||
}
|
}
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from .util import api_process, api_process_hostcontroll, json_loads
|
from .util import api_process, api_process_hostcontroll, json_loads
|
||||||
from ..const import ATTR_VERSION, HASSIO_VERSION
|
from ..const import ATTR_VERSION, ATTR_CURRENT, HASSIO_VERSION
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ class APISupervisor(object):
|
|||||||
"""Return host information."""
|
"""Return host information."""
|
||||||
info = {
|
info = {
|
||||||
ATTR_VERSION: HASSIO_VERSION,
|
ATTR_VERSION: HASSIO_VERSION,
|
||||||
|
ATTR_CURRENT: self.config.current_hassio,
|
||||||
}
|
}
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
@ -24,5 +24,4 @@ RESULT_ERROR = 'error'
|
|||||||
RESULT_OK = 'ok'
|
RESULT_OK = 'ok'
|
||||||
|
|
||||||
ATTR_VERSION = 'version'
|
ATTR_VERSION = 'version'
|
||||||
ATTR_NEED_UPDATE = 'need_update'
|
ATTR_CURRENT = 'current'
|
||||||
ATTR_NEXT_VERSION = 'next_version'
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user