Updating API library to match new features of Hass.io 0.79

This commit is contained in:
Franck Nijhof 2018-01-06 22:32:55 +01:00
parent 240ec98126
commit 8ce46a79f3
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
4 changed files with 112 additions and 15 deletions

View file

@ -176,6 +176,20 @@ hass.api.addons.info.description() {
hass.api.addons.info "${addon}" ".description"
}
# ------------------------------------------------------------------------------
# Returns the long description of an add-on
#
# Arguments:
# $1 Add-on slug
# Returns:
# Description of the add-on
# ------------------------------------------------------------------------------
hass.api.addons.info.long_description() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".long_description"
}
# ------------------------------------------------------------------------------
# Returns the version of an add-on
#
@ -330,6 +344,34 @@ hass.api.addons.info.host_network() {
hass.api.addons.info "${addon}" ".host_network // false"
}
# ------------------------------------------------------------------------------
# Returns whether or not this add-on has IPC access
#
# Arguments:
# $1 Add-on slug
# Returns:
# Whether or not this add-on has IPC access
# ------------------------------------------------------------------------------
hass.api.addons.info.host_ipc() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".host_ipc // false"
}
# ------------------------------------------------------------------------------
# Returns whether or not this add-on has DBus access to the host
#
# Arguments:
# $1 Add-on slug
# Returns:
# Whether or not this add-on has DBus access
# ------------------------------------------------------------------------------
hass.api.addons.info.host_dbus() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".host_dbus // false"
}
# ------------------------------------------------------------------------------
# Returns the privileges the add-on has on to the hardware / system.
#
@ -358,6 +400,20 @@ hass.api.addons.info.devices() {
hass.api.addons.info "${addon}" ".devices"
}
# ------------------------------------------------------------------------------
# Returns if UART was made available to the add-on
#
# Arguments:
# $1 Add-on slug
# Returns:
# Whether or not this add-on as automatic UART enabled
# ------------------------------------------------------------------------------
hass.api.addons.info.auto_uart() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".auto_uart // false"
}
# ------------------------------------------------------------------------------
# Returns whether or not this add-on has a logo available
#
@ -372,6 +428,20 @@ hass.api.addons.info.logo() {
hass.api.addons.info "${addon}" ".logo // false"
}
# ------------------------------------------------------------------------------
# Returns whether or not this add-on has a changelog available
#
# Arguments:
# $1 Add-on slug
# Returns:
# Whether or not this add-on has a changelog available
# ------------------------------------------------------------------------------
hass.api.addons.info.changelog() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".changelog // false"
}
# ------------------------------------------------------------------------------
# A URL for web interface of this add-on
#
@ -467,7 +537,7 @@ hass.api.addons.info.audio() {
hass.api.addons.info.audio_input() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".audio_input"
hass.api.addons.info "${addon}" ".audio_input // empty"
}
# ------------------------------------------------------------------------------
@ -481,7 +551,7 @@ hass.api.addons.info.audio_input() {
hass.api.addons.info.audio_output() {
local addon=${1}
hass.log.trace "${FUNCNAME[0]}" "$@"
hass.api.addons.info "${addon}" ".audio_output"
hass.api.addons.info "${addon}" ".audio_output // empty"
}
# ------------------------------------------------------------------------------

View file

@ -62,19 +62,6 @@ hass.api.homeassistant.info.image() {
hass.api.homeassistant.info ".image"
}
# ------------------------------------------------------------------------------
# Returns a list of devices available to Home Assistant
#
# Arguments:
# None
# Returns:
# List of devices
# ------------------------------------------------------------------------------
hass.api.homeassistant.info.devices() {
hass.log.trace "${FUNCNAME[0]}"
hass.api.homeassistant.info ".devices[]"
}
# ------------------------------------------------------------------------------
# Returns whether or not a custom version of Home Assistant is installed
#

View file

@ -154,6 +154,19 @@ hass.api.host.hardware.disk() {
hass.api.host.hardware ".disk[]"
}
# ------------------------------------------------------------------------------
# Returns a list of available disk devices on the host system
#
# Arguments:
# None
# Returns:
# JSON object
# ------------------------------------------------------------------------------
hass.api.host.hardware.gpio() {
hass.log.trace "${FUNCNAME[0]}"
hass.api.host.hardware ".gpio[]"
}
# ------------------------------------------------------------------------------
# Returns a list of available audio devices on the host system
#
@ -205,3 +218,17 @@ hass.api.host.update() {
hass.log.trace "${FUNCNAME[0]}"
hass.api.call POST /host/update
}
# ------------------------------------------------------------------------------
# Reload the host controller
#
# Arguments:
# None
# Returns:
# None
# ------------------------------------------------------------------------------
hass.api.host.reload() {
hass.log.trace "${FUNCNAME[0]}"
hass.api.call POST /host/reload
}

View file

@ -97,6 +97,19 @@ hass.api.supervisor.info.timezone() {
hass.api.supervisor.info ".timezone"
}
# ------------------------------------------------------------------------------
# Returns the time to wait after boot in seconds
#
# Arguments:
# None
# Returns:
# Second to wait for boot
# ------------------------------------------------------------------------------
hass.api.supervisor.info.wait_boot() {
hass.log.trace "${FUNCNAME[0]}"
hass.api.supervisor.info ".wait_boot"
}
# ------------------------------------------------------------------------------
# Returns a list of all current installed add-ons
#