mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
commit
8f5e4c0d50
5 changed files with 31 additions and 30 deletions
|
@ -17,7 +17,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
|||
|
||||
Home automation platform
|
||||
|
||||
**Shipped version:** 2022.12.8~ynh1
|
||||
**Shipped version:** 2023.1.3~ynh1
|
||||
|
||||
**Demo:** https://demo.home-assistant.io
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
|
|||
|
||||
Plateforme domotique
|
||||
|
||||
**Version incluse :** 2022.12.8~ynh1
|
||||
**Version incluse :** 2023.1.3~ynh1
|
||||
|
||||
**Démo :** https://demo.home-assistant.io
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
|
||||
# Uncomment to enable debugging to stderr (prints full client output and more)
|
||||
DEBUG=0
|
||||
#DEBUG=1
|
||||
|
||||
# define usefull variables
|
||||
app="homeassistant"
|
||||
|
@ -18,19 +18,7 @@ data_path="/home/yunohost.app/$app"
|
|||
|
||||
# Log messages to log file.
|
||||
log() {
|
||||
echo "$(date)\t$1" >> $LOG_FILE
|
||||
}
|
||||
|
||||
has_sudo() {
|
||||
local prompt
|
||||
prompt=$(sudo -nv 2>&1)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "has sudo pass set"
|
||||
elif echo $prompt | grep -q '^sudo:'; then
|
||||
echo "has sudo needs pass"
|
||||
else
|
||||
echo "can't sudo"
|
||||
fi
|
||||
echo "$(date) $1" >> $LOG_FILE
|
||||
}
|
||||
|
||||
# Reset log file.
|
||||
|
@ -39,28 +27,41 @@ if [ ! -z "$DEBUG" ]; then
|
|||
[ -f "$LOG_FILE" ] && :> "$LOG_FILE"
|
||||
fi
|
||||
|
||||
# Check User and permissions
|
||||
[ ! -z "$DEBUG" ] && log "User '$(whoami)' is running that script and '$(has_sudo)'."
|
||||
|
||||
# upgrade the virtual environment
|
||||
MY_PYTHON=$(readlink -e "$final_path/bin/python")
|
||||
[ ! -z "$DEBUG" ] && log "Using pyhton '$MY_PYTHON'."
|
||||
$MY_PYTHON -m venv --upgrade "$final_path"
|
||||
|
||||
# Run source in a 'sub shell'
|
||||
(
|
||||
# activate the virtual environment
|
||||
set +o nounset
|
||||
[ ! -z "$DEBUG" ] && log "Activate the virtual environment"
|
||||
source "$final_path/bin/activate"
|
||||
set -o nounset
|
||||
|
||||
# add pip
|
||||
[ ! -z "$DEBUG" ] && log "Upgrade pip"
|
||||
"$final_path/bin/python3" -m ensurepip --upgrade
|
||||
|
||||
local VERBOSE
|
||||
[ ! -z "$DEBUG" ] && VERBOSE="--log $LOG_FILE"
|
||||
|
||||
# install last version of wheel
|
||||
pip --cache-dir "$data_path/.cache" install --upgrade wheel
|
||||
[ ! -z "$DEBUG" ] && log "Install latest pip version of wheel"
|
||||
"$final_path/bin/pip3" --cache-dir "$data_path/.cache" install --upgrade wheel $VERBOSE
|
||||
|
||||
# install last version of mysqlclient
|
||||
pip --cache-dir "$data_path/.cache" install --upgrade mysqlclient
|
||||
[ ! -z "$DEBUG" ] && log "Install latest pip version of mysqlclient"
|
||||
"$final_path/bin/pip3" --cache-dir "$data_path/.cache" install --upgrade mysqlclient $VERBOSE
|
||||
|
||||
# upgrade homeassistant python package
|
||||
pip --cache-dir "$data_path/.cache" install --upgrade $app
|
||||
[ ! -z "$DEBUG" ] && log "Install latest pip version of $app"
|
||||
"$final_path/bin/pip3" --cache-dir "$data_path/.cache" install --upgrade $app $VERBOSE
|
||||
)
|
||||
|
||||
# restart homeassistant systemd service
|
||||
[ ! -z "$DEBUG" ] && log "Restart $app systemd service"
|
||||
sudo systemctl restart $app.service
|
||||
[ ! -z "$DEBUG" ] && log "Last $app service start : $(sudo systemctl status $app.service | grep Started | tail -1)"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"en": "Home automation platform",
|
||||
"fr": "Plateforme domotique"
|
||||
},
|
||||
"version": "2022.12.8~ynh1",
|
||||
"version": "2023.1.3~ynh1",
|
||||
"url": "https://github.com/home-assistant/home-assistant",
|
||||
"upstream": {
|
||||
"license": "Apache-2.0",
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#=================================================
|
||||
|
||||
# Release to install
|
||||
app_version=2022.12.8
|
||||
app_version=2023.1.3
|
||||
|
||||
# Package dependencies
|
||||
pkg_dependencies="python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0 libmariadb-dev libmariadb-dev-compat rustc"
|
||||
|
|
Loading…
Reference in a new issue