mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-03 18:41:31 +00:00
Add Supervisor country (#165)
This commit is contained in:
parent
445707a903
commit
5059ff133e
1 changed files with 20 additions and 0 deletions
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue