mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
🔨 Update addons API methods (#36)
This commit is contained in:
parent
4930d1c4c6
commit
3765aa9bf0
1 changed files with 71 additions and 5 deletions
|
@ -101,15 +101,28 @@ function bashio::addon.update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# RAW Docker log of the specified add-on.
|
# RAW Docker logs of the specified add-on.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 Add-on slug (optional, default: self)
|
# $1 Add-on slug (optional, default: self)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::addon.log() {
|
function bashio::addon.logs() {
|
||||||
local slug=${1:-'self'}
|
local slug=${1:-'self'}
|
||||||
bashio::log.trace "${FUNCNAME[0]}"
|
bashio::log.trace "${FUNCNAME[0]}"
|
||||||
bashio::api.supervisor GET "/addons/${slug}/log" true
|
bashio::api.supervisor GET "/addons/${slug}/logs" true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Returns the documentation of the add-on.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
function bashio::addon.documentation() {
|
||||||
|
local slug=${1:-'self'}
|
||||||
|
bashio::log.trace "${FUNCNAME[0]}"
|
||||||
|
bashio::api.supervisor GET "/addons/${slug}/documentation" true
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -334,7 +347,7 @@ function bashio::addon.advanced() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Returns th stage the add-on is currently in.
|
# Returns the stage the add-on is currently in.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 Add-on slug (optional, default: self)
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
@ -345,6 +358,18 @@ function bashio::addon.stage() {
|
||||||
bashio::addons "${slug}" "addons.${slug}.stage" '.stage'
|
bashio::addons "${slug}" "addons.${slug}.stage" '.stage'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Returns the phase the add-on is started up.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
function bashio::addon.startup() {
|
||||||
|
local slug=${1:-'self'}
|
||||||
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
|
bashio::addons "${slug}" "addons.${slug}.startup" '.startup'
|
||||||
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Returns list of supported architectures by the add-on.
|
# Returns list of supported architectures by the add-on.
|
||||||
#
|
#
|
||||||
|
@ -705,13 +730,27 @@ function bashio::addon.logo() {
|
||||||
bashio::addons "${slug}" "addons.${slug}.logo" '.logo // false'
|
bashio::addons "${slug}" "addons.${slug}.logo" '.logo // false'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Returns whether or not this add-on has documentation available.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
function bashio::addon.has_documentation() {
|
||||||
|
local slug=${1:-'self'}
|
||||||
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
|
bashio::addons \
|
||||||
|
"${slug}" \
|
||||||
|
"addons.${slug}.documentation" '.documentation // false'
|
||||||
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Returns whether or not this add-on has a changelog available.
|
# Returns whether or not this add-on has a changelog available.
|
||||||
#
|
#
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 Add-on slug (optional, default: self)
|
# $1 Add-on slug (optional, default: self)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::addon.changelog() {
|
function bashio::addon.has_changelog() {
|
||||||
local slug=${1:-'self'}
|
local slug=${1:-'self'}
|
||||||
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
bashio::addons "${slug}" "addons.${slug}.changelog" '.changelog // false'
|
bashio::addons "${slug}" "addons.${slug}.changelog" '.changelog // false'
|
||||||
|
@ -741,6 +780,18 @@ function bashio::addon.hassio_role() {
|
||||||
bashio::addons "${slug}" "addons.${slug}.hassio_role" '.hassio_role'
|
bashio::addons "${slug}" "addons.${slug}.hassio_role" '.hassio_role'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Returns the minimal required Home Assistant version needed by this add-on.
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
function bashio::addon.homeassistant() {
|
||||||
|
local slug=${1:-'self'}
|
||||||
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
|
bashio::addons "${slug}" "addons.${slug}.homeassistant" '.homeassistant'
|
||||||
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Returns whether or not this add-on can access the Home Assistant API.
|
# Returns whether or not this add-on can access the Home Assistant API.
|
||||||
#
|
#
|
||||||
|
@ -804,6 +855,21 @@ function bashio::addon.stdin() {
|
||||||
bashio::addons "${slug}" "addons.${slug}.stdin" '.stdin // false'
|
bashio::addons "${slug}" "addons.${slug}.stdin" '.stdin // false'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Returns whether or not this add-on has full access
|
||||||
|
#
|
||||||
|
# Arguments:
|
||||||
|
# $1 Add-on slug (optional, default: self)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
function bashio::addon.full_access() {
|
||||||
|
local slug=${1:-'self'}
|
||||||
|
bashio::log.trace "${FUNCNAME[0]}" "$@"
|
||||||
|
bashio::addons \
|
||||||
|
"${slug}" \
|
||||||
|
"addons.${slug}.full_access" \
|
||||||
|
'.full_access // false'
|
||||||
|
}
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# A URL for web interface of this add-on.
|
# A URL for web interface of this add-on.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue