Replace update available logic with property access (#43)

This commit is contained in:
Franck Nijhof 2021-01-14 03:15:55 +01:00 committed by GitHub
parent 1662ddf17f
commit 4fc9a14155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 28 deletions

View file

@ -85,19 +85,8 @@ function bashio::cli.version_latest() {
# Checks if there is an update available for the CLI. # Checks if there is an update available for the CLI.
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function bashio::cli.update_available() { function bashio::cli.update_available() {
local version bashio::log.trace "${FUNCNAME[0]}" "$@"
local version_latest bashio::cli 'cli.info.update_available' '.update_available // false'
bashio::log.trace "${FUNCNAME[0]}"
version=$(bashio::cli.version)
version_latest=$(bashio::cli.version_latest)
if [[ "${version}" = "${version_latest}" ]]; then
return "${__BASHIO_EXIT_NOK}"
fi
return "${__BASHIO_EXIT_OK}"
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View file

@ -122,22 +122,11 @@ function bashio::core.version_latest() {
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Checks if there is an update available for the Supervisor. # Checks if there is an update available for Home Assistant.
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function bashio::supervisor.update_available() { function bashio::core.update_available() {
local version bashio::log.trace "${FUNCNAME[0]}" "$@"
local version_latest bashio::cli 'core.info.update_available' '.update_available // false'
bashio::log.trace "${FUNCNAME[0]}"
version=$(bashio::core.version)
version_latest=$(bashio::core.version_latest)
if [[ "${version}" = "${version_latest}" ]]; then
return "${__BASHIO_EXIT_NOK}"
fi
return "${__BASHIO_EXIT_OK}"
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------