-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(home-assistant): Run in a virtualenv
- Loading branch information
1 parent
26a7986
commit 06c74d8
Showing
3 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
#!/usr/bin/env bash | ||
#shellcheck disable=SC2086 | ||
|
||
unset UV_SYSTEM_PYTHON | ||
# Ensure $VENV_FOLDER directory exists. | ||
mkdir -p "${VENV_FOLDER}" | ||
|
||
# Create venv if required. | ||
uv venv --system-site-packages --allow-existing "${VENV_FOLDER}" | ||
# Install uv into the venv if required. This is needed for home-assistant to properly invoke uv to install additional deps. | ||
uv pip freeze --system | grep ^uv= | xargs uv pip install | ||
# Activate the venv | ||
source "${VENV_FOLDER}/bin/activate" | ||
|
||
if [[ "${HOME_ASSISTANT__HACS_INSTALL}" == "true" ]]; then | ||
curl -sfSL https://get.hacs.xyz | bash - | ||
fi | ||
|
||
exec \ | ||
/usr/local/bin/hass \ | ||
python3 -m homeassistant \ | ||
--config /config \ | ||
"$@" |