Skip to content
Draft
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
10 changes: 5 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "lock_code_manager Dev",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"image": "mcr.microsoft.com/devcontainers/python:1-3.13",
"forwardPorts": [8123],
"features": {
"ghcr.io/anthropics/devcontainer-features/claude-code:1.0": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.13",
"installTools": false
}
"ghcr.io/devcontainers/features/rust:1": {}
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rust feature is added but there's no evidence of Rust code in the repository (no Cargo.toml or .rs files). While Rust might be needed to build certain Python packages with native extensions, or for the uv tool itself (which is written in Rust), uv is typically distributed as a prebuilt binary and doesn't require Rust at runtime. Consider whether this feature is actually needed, as it adds unnecessary dependencies to the development container.

Copilot uses AI. Check for mistakes.
},
"containerEnv": {
"DEVCONTAINER": "1",
"PIP_BREAK_SYSTEM_PACKAGES": "1"
},
"postCreateCommand": "scripts/setup-devcontainer",
"postStartCommand": "scripts/setup-devcontainer",
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding postStartCommand to run setup-devcontainer will execute this script every time the container starts, not just when it's created. This could lead to unnecessary reinstallation of dependencies and re-running of setup tasks on every container restart. The stamp file mechanism (lines 61-65 in setup-devcontainer) will help skip reinstalls when requirements haven't changed, but other operations like pre-commit install, yarn install, and file copying will still run. Consider whether this is the intended behavior or if postCreateCommand alone is sufficient.

Suggested change
"postStartCommand": "scripts/setup-devcontainer",

Copilot uses AI. Check for mistakes.
"customizations": {
"vscode": {
"extensions": [
Expand Down
2 changes: 2 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"module": "homeassistant",
"args": ["--debug", "--config", "${workspaceFolder}/.ha"],
"cwd": "${workspaceFolder}/.ha",
"python": "${workspaceFolder}/.ha/venv/bin/python",
"pythonPath": "${workspaceFolder}/.ha/venv/bin/python",
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both 'python' and 'pythonPath' are specified with the same value. The 'pythonPath' property is deprecated in favor of 'python' in recent versions of the Python debugger extension. Consider removing the 'pythonPath' line to avoid redundancy and use the modern property only.

Suggested change
"pythonPath": "${workspaceFolder}/.ha/venv/bin/python",

Copilot uses AI. Check for mistakes.
"subProcess": false,
"justMyCode": false
}
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
},
"eslint.workingDirectories": [
"."
]
],
"python.defaultInterpreterPath": "${workspaceFolder}/.ha/venv/bin/python"
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Home Assistant (venv)",
"type": "shell",
"command": "${workspaceFolder}/.ha/venv/bin/python",
"args": [
"-m",
"homeassistant",
"--debug",
"--config",
"${workspaceFolder}/.ha"
],
"options": {
"cwd": "${workspaceFolder}/.ha"
},
"problemMatcher": []
}
]
}
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,13 @@ yarn build # Build frontend strategy module
yarn watch # Watch mode for development
```

**Important:** After modifying any TypeScript files in `ts/`, you **must** rebuild
the JavaScript bundle before testing in the browser. The compiled output is
`custom_components/lock_code_manager/www/lock-code-manager-strategy.js`. If you
forget to rebuild, the browser will load stale JavaScript and the Lovelace
strategy will fail with errors like:
`Timeout waiting for strategy element ll-strategy-dashboard-lock-code-manager to be registered`

## Code Style

- Python: Ruff for linting/formatting (line length: 88)
Expand Down
14 changes: 11 additions & 3 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ uv pip install -r requirements_dev.txt
pre-commit install
yarn install

# Setup directories for HA and linking
ensure_link "${PWD}/dev/configuration.yaml" "${PWD}/.ha/configuration.yaml"
ensure_link "${PWD}/dev/virtual.yaml" "${PWD}/.ha/virtual.yaml"
# Setup directories for HA config
mkdir -p "${PWD}/.ha/custom_components"

# Copy yaml config files to .ha (makes .ha self-contained for volume mounting)
for yaml_file in "${PWD}"/dev/*.yaml; do
if [ -f "$yaml_file" ]; then
cp "$yaml_file" "${PWD}/.ha/"
fi
done

# Link the component being developed
ensure_link "${PWD}/custom_components/lock_code_manager" "${PWD}/.ha/custom_components/lock_code_manager"

# Download and extract Virtual component if not already present
Expand Down
Loading