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-11-20 13:49:26 +01:00
parent e0a7f57396
commit 3f162902c1
3 changed files with 8 additions and 4 deletions

View file

@ -143,14 +143,17 @@ myynh_install_homeassistant () {
local legacy_args=u
local -A args_array=( [p]=path= )
local path
# Manage arguments with getopts
ynh_handle_getopts_args "$@"
exec_as $app -H -s /bin/bash -c " \
echo 'create the virtual environment' \
&& $MY_PYTHON -m venv "$final_path" \
&& echo 'activate the virtual environment' \
&& source "$final_path/bin/activate" \
&& echo 'install last version of wheel' \
&& pip --cache-dir "$1/.cache" install --upgrade wheel \
&& pip --cache-dir "$path/.cache" install --upgrade wheel \
&& echo 'install Home Assistant' \
&& pip --cache-dir "$1/.cache" install --upgrade $app==$VERSION \
&& pip --cache-dir "$path/.cache" install --upgrade $app==$VERSION \
"
}

View file

@ -48,6 +48,7 @@ chown $app: "$final_path"
# create a directory for the datas of Home Assistant
myynh_create_dir "$data_path/.$app"
myynh_create_dir "$data_path/.cache"
chown -R $app: "$data_path"
# build (if needed) & install Pyhton
@ -55,7 +56,7 @@ myynh_install_dependencies --python="$PY_REQUIRED_VERSION"
# installation in a virtual environment
ynh_script_progression --message="Installing Home Assistant in a virtual environment..."
myynh_install_homeassistant --path="$data_path"
ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path"
# set default configuration files and move all homeassistant_conf_files
ynh_script_progression --message="Configuring the installation..."

View file

@ -49,7 +49,7 @@ ynh_systemd_action --service_name="$app@$app" --action=stop --line_match="Stoppe
# installation in a virtual environment
ynh_script_progression --message="Installing Home Assistant in a virtual environment..."
myynh_install_homeassistant --path="$data_path"
ynh_exec_fully_quiet myynh_install_homeassistant --path="$data_path"
# update script in bin
ynh_script_progression --message="Updating YunoHost script used by homeassitant..."