Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
},
"remoteUser": "vscode",
"features": {
"ghcr.io/va-h/devcontainers-features/uv:1": {},
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
"packages": [
"ffmpeg",
Expand Down
23 changes: 13 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ name = "panda_status"
version = "1.2.0"
requires-python = ">=3.13.2"
dependencies = [
"colorlog>=6.9.0",
"hassil>=3.2.0",
"colorlog",
"ffmpeg",
"ha-ffmpeg",
"hassil",
"home-assistant-intents==2025.9.3",
"homeassistant==2025.8.1",
"mutagen>=1.47.0",
"numpy>=2.3.2",
"mutagen",
"numpy",
"pip>=25.2",
"pip>=25.2",
"pymicro-vad",
"pyspeex-noise",
"PyTurboJPEG",
"ruff>=0.12.12",
"websockets>=15.0.1",
]

[dependency-groups]
dev = [
"ruff>=0.12.12"
"ruff>=0.12.12",
"websockets",
"websockets",
]
14 changes: 9 additions & 5 deletions scripts/develop
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ set -e

cd "$(dirname "$0")/.."

echo "🐼 [develop] Starting Home Assistant development environment in $(pwd)"

# Create config dir if not present
if [[ ! -d "${PWD}/config" ]]; then
echo "📁 [develop] Creating config directory..."
mkdir -p "${PWD}/config"
hass --config "${PWD}/config" --script ensure_config
echo "⚙️ [develop] Ensuring Home Assistant config..."
uv run hass --config "${PWD}/config" --script ensure_config
echo "✅ [develop] Config directory ready."
fi

# Set the path to custom_components
## This let's us have the structure we want <root>/custom_components/panda_status
## while at the same time have Home Assistant configuration inside <root>/config
## without resulting to symlinks.
echo "🔧 [develop] Setting PYTHONPATH for custom_components..."
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components"

# Start Home Assistant
hass --config "${PWD}/config" --debug
echo "🚀 [develop] Starting Home Assistant with debug mode..."
uv run hass --config "${PWD}/config" --debug
14 changes: 12 additions & 2 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@ set -e

cd "$(dirname "$0")/.."

ruff format .
ruff check . --fix
echo "🐼 [lint] Starting linting in $(pwd)"

# Run ruff format and check
echo "🧹 [lint] Running ruff format..."
uv run ruff format .
echo "✅ [lint] Formatting complete."

echo "🔎 [lint] Running ruff check with --fix..."
uv run ruff check . --fix
echo "✅ [lint] Linting complete."

echo "🎉 [lint] Linting finished."
27 changes: 26 additions & 1 deletion scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,29 @@ set -e

cd "$(dirname "$0")/.."

uv venv && uv pip install -r pyproject.toml
echo "🐼 [setup] Starting setup in $(pwd)"

# Download UV if not present
if ! command -v uv >/dev/null 2>&1; then
echo "🔍 [setup] 'uv' not found. Installing UV..."
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "✅ [setup] UV installed."
else
echo "✅ [setup] 'uv' is already installed."
fi

# Create venv if not present
if [[ ! -d "${PWD}/.venv" ]]; then
echo "🔧 [setup] Creating Python virtual environment (.venv)..."
uv venv
echo "✅ [setup] Virtual environment created."
else
echo "✅ [setup] Virtual environment already exists."
fi

# Install dependencies
echo "📦 [setup] Installing dependencies with uv..."
uv sync --dev --frozen --link-mode=copy
echo "✅ [setup] Dependencies installed."

echo "🎉 [setup] Setup complete."
50 changes: 28 additions & 22 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.