1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/homeassistant_ynh.git synced 2024-09-03 19:26:16 +02:00
This commit is contained in:
ewilly 2021-12-07 21:11:30 +01:00
parent e59e463e3d
commit cb40e4e59c
4 changed files with 8 additions and 7 deletions

View file

@ -9,6 +9,7 @@ DEBUG=0
# define usefull variables
app="homeassistant"
final_path="/var/www/$app"
data_path="/home/yunohost.app/$app"
########## END OF CONFIGURATION ##########
@ -50,10 +51,10 @@ $MY_PYTHON -m venv "$final_path"
source "$final_path/bin/activate"
# install last version of wheel
pip --no-cache-dir install --upgrade wheel
pip --cache-dir "$data_path/.cache" install --upgrade wheel
# upgrade homeassistant python package
pip --no-cache-dir install --upgrade $app
pip --cache-dir "$data_path/.cache" install --upgrade $app
# restart homeassistant systemd service
sudo systemctl restart $app.service

View file

@ -131,9 +131,9 @@ myynh_install_homeassistant () {
&& echo 'activate the virtual environment' \
&& source "$final_path/bin/activate" \
&& echo 'install last version of wheel' \
&& pip --no-cache-dir install --upgrade wheel \
&& pip --cache-dir "$data_path/.cache" install --upgrade wheel \
&& echo 'install Home Assistant' \
&& pip --no-cache-dir install --upgrade $app==$VERSION \
&& pip --cache-dir "$data_path/.cache" install --upgrade $app==$VERSION \
"
}

View file

@ -51,7 +51,7 @@ myynh_create_dir "$(dirname "$log_file")"
touch "$log_file"
# create a directory for the datas of Home Assistant
myynh_create_dir "$data_path"
myynh_create_dir "$data_path/.cache"
# build (if needed) & install Pyhton
ynh_script_progression --message="Installing dependencies..."

View file

@ -57,10 +57,10 @@ if [ ! -d "$final_path" ]; then
mv "/opt/yunohost/$app" "$final_path"
fi
if [ ! -d "$data_path" ]; then
# remove pip cache
ynh_secure_remove --file="/home/homeassistant/.cache"
# move $data_path to new directory
mv "/""home""/$app" "$data_path"
mv "$data_path/.$app/." "$data_path"
rmdir "$data_path/.$app"
ynh_replace_string --match_string="/home/homeassistant/.homeassistant" --replace_string="$data_path" --target_file="$data_path/configuration.yaml"
fi
if [ ! -f "$log_file" ]; then