From 0d122264c639141f237af612b75a275e24a3e9ae Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sun, 9 Feb 2020 10:41:01 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Adds=20new=20Supervisor=20add-on=20?= =?UTF-8?q?properties=20(#17)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/addons.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/addons.sh b/lib/addons.sh index 9be6842..b3296d8 100644 --- a/lib/addons.sh +++ b/lib/addons.sh @@ -321,6 +321,30 @@ function bashio::addon.available() { bashio::addons "${slug}" "addons.${slug}.available" '.available // false' } +# ------------------------------------------------------------------------------ +# Returns is this is an advanced add-on. +# +# Arguments: +# $1 Add-on slug (optional, default: self) +# ------------------------------------------------------------------------------ +function bashio::addon.advanced() { + local slug=${1:-'self'} + bashio::log.trace "${FUNCNAME[0]}" "$@" + bashio::addons "${slug}" "addons.${slug}.advanced" '.advanced // false' +} + +# ------------------------------------------------------------------------------ +# Returns th stage the add-on is currently in. +# +# Arguments: +# $1 Add-on slug (optional, default: self) +# ------------------------------------------------------------------------------ +function bashio::addon.stage() { + local slug=${1:-'self'} + bashio::log.trace "${FUNCNAME[0]}" "$@" + bashio::addons "${slug}" "addons.${slug}.stage" '.stage' +} + # ------------------------------------------------------------------------------ # Returns list of supported architectures by the add-on. # @@ -843,6 +867,18 @@ function bashio::addon.docker_api() { bashio::addons "${slug}" "addons.${slug}.docker_api" '.docker_api // false' } +# ------------------------------------------------------------------------------ +# Returns whether or not this add-on can access video devices. +# +# Arguments: +# $1 Add-on slug (optional, default: self) +# ------------------------------------------------------------------------------ +function bashio::addon.video() { + local slug=${1:-'self'} + bashio::log.trace "${FUNCNAME[0]}" "$@" + bashio::addons "${slug}" "addons.${slug}.video" '.video // false' +} + # ------------------------------------------------------------------------------ # Returns whether or not this add-on can access an audio device. #