Many bug fixes and fixes of deprecated code, update of dev environment and dependencies

This commit is contained in:
Ron Klinkien
2025-01-20 10:16:05 +00:00
parent 34d88ff534
commit 36d6f7720d
35 changed files with 938 additions and 705 deletions

19
scripts/develop Normal file → Executable file
View File

@@ -4,16 +4,19 @@ set -e
cd "$(dirname "$0")/.."
# Create config dir if not present
if [[ ! -d "${PWD}/config" ]]; then
mkdir -p "${PWD}/config"
hass --config "${PWD}/config" --script ensure_config
if [ ! -f "${PWD}/config/configuration.yaml" ]; then
mkdir -p "${PWD}/config"
hass --config "${PWD}/config" --script ensure_config
echo "Updating default configuration."
echo "
logger:
default: info
logs:
custom_components.garmin_connect: debug
" >> "${PWD}/config/configuration.yaml"
fi
# Set the path to custom_components
## This let's us have the structure we want <root>/custom_components/integration_blueprint
## while at the same time have Home Assistant configuration inside <root>/config
## without resulting to symlinks.
# Set the python path to include our custom_components directory
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"
# Start Home Assistant

7
scripts/install/core Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/../.."
bash scripts/install/pip_packages --requirement requirements_core_min.txt

7
scripts/install/core_dev Executable file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")/../.."
bash scripts/install/pip_packages "git+https://github.com/home-assistant/core.git@dev"

1
scripts/install/pip_packages Normal file → Executable file
View File

@@ -6,4 +6,5 @@ python3 -m pip \
install \
--upgrade \
--disable-pip-version-check \
--constraint constraints.txt \
"${@}"

5
scripts/lint Normal file → Executable file
View File

@@ -4,10 +4,7 @@ set -e
cd "$(dirname "$0")/.."
python3 -m pip install --requirement requirements_lint.txt
ruff check . --fix;
pre-commit install-hooks --config .github/pre-commit-config.yaml;
pre-commit run --hook-stage manual --all-files --config .github/pre-commit-config.yaml;
vulture . --min-confidence 55 --ignore-names policy
vulture . --min-confidence 75 --ignore-names policy

7
scripts/setup Normal file → Executable file
View File

@@ -4,4 +4,9 @@ set -e
cd "$(dirname "$0")/.."
python3 -m pip install --requirement requirements.txt
scripts/install/pip_packages "pip<23.2,>=21.3.1"
scripts/install/pip_packages setuptools wheel
scripts/install/pip_packages --requirement requirements_lint.txt
scripts/install/core
pre-commit install --config .github/pre-commit-config.yaml