From fe857585201ed01d1f00aebcc8df5549756455f1 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Sat, 1 Mar 2025 13:33:18 +0100 Subject: [PATCH] Update homeassistant-core.sh --- ct/homeassistant-core.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/ct/homeassistant-core.sh b/ct/homeassistant-core.sh index 85f181a9c..863080634 100644 --- a/ct/homeassistant-core.sh +++ b/ct/homeassistant-core.sh @@ -57,6 +57,29 @@ function update_script() { systemctl stop homeassistant msg_ok "Stopped Home Assistant" + version=$(python3 --version 2>&1) + + # Extract the version number + if [[ $version == "Python 3.13"* ]]; then + echo "Python 3.13 is installed." + else + msg_info "Update Python" + $STD apt-get update + $STD rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + $STD apt-get remove --purge -y python3.* python3.*-dev python3.*-venv + + $STD apt-get install -y \ + python3.13 \ + python3-pip \ + python3.13-dev \ + python3.13-venv + + ln -sf /usr/bin/python3.13 /usr/bin/python3 + mdg_ok "Updated Python" + fi + + + msg_info "Updating Home Assistant" source /srv/homeassistant/bin/activate $STD pip install ${BR}--upgrade homeassistant @@ -131,4 +154,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8123${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8123${CL}"