Add Supervisor country (#165)

This commit is contained in:
Stefan Agner 2025-04-29 11:37:24 +02:00 committed by GitHub
parent 445707a903
commit 5059ff133e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,6 +182,26 @@ function bashio::supervisor.timezone() {
fi
}
# ------------------------------------------------------------------------------
# Returns or sets the current country of the system.
#
# Arguments:
# $1 Country to set (optional).
# ------------------------------------------------------------------------------
function bashio::supervisor.country() {
local country=${1:-}
bashio::log.trace "${FUNCNAME[0]}:" "$@"
if bashio::var.has_value "${country}"; then
channel=$(bashio::var.json country "${country}")
bashio::api.supervisor POST /supervisor/options "${country}"
bashio::cache.flush_all
else
bashio::supervisor 'supervisor.info.country' '.country'
fi
}
# ------------------------------------------------------------------------------
# Returns the current logging level of the Supervisor.
#