-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rework and update devcontainer
- Loading branch information
Showing
6 changed files
with
70 additions
and
68 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
4 changes: 2 additions & 2 deletions
4
.devcontainer/configuration.yaml → .devcontainer/config/configuration.yaml
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,11 @@ | ||
# Loads default set of integrations. Do not remove. | ||
default_config: | ||
|
||
logger: | ||
default: info | ||
logs: | ||
custom_components.auto_backup: debug | ||
|
||
backup: | ||
# If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/) | ||
# debugpy: | ||
|
||
automation: !include automations.yaml |
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,31 +1,44 @@ | ||
// See https://aka.ms/vscode-remote/devcontainer.json for format details. | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"image": "ghcr.io/ludeeus/devcontainer/integration:stable", | ||
"name": "Auto Backup integration development", | ||
"context": "..", | ||
"appPort": [ | ||
"9123:8123" | ||
], | ||
"postCreateCommand": "container install", | ||
"extensions": [ | ||
"ms-python.python", | ||
"github.vscode-pull-request-github", | ||
"ryanluker.vscode-coverage-gutters", | ||
"ms-python.vscode-pylance", | ||
"keesschollaart.vscode-home-assistant" | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.tabSize": 4, | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"python.pythonPath": "/usr/bin/python3", | ||
"python.analysis.autoSearchPaths": false, | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true | ||
} | ||
} | ||
"name": "jcwillox/hass-auto-backup", | ||
|
||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [8123], | ||
"portsAttributes": { | ||
"8123": { | ||
"label": "Home Assistant", | ||
"onAutoForward": "notify" | ||
} | ||
}, | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "poetry install", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"editorconfig.editorconfig", | ||
"christian-kohler.path-intellisense", | ||
"esbenp.prettier-vscode", | ||
"redhat.vscode-yaml", | ||
"ms-python.python", | ||
"ms-python.black-formatter", | ||
"keesschollaart.vscode-home-assistant", | ||
"tamasfe.even-better-toml" | ||
] | ||
} | ||
} | ||
|
||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
export PYTHONPATH="${PYTHONPATH}:${PWD}/custom_components" | ||
|
||
hass -c .devcontainer/config --debug |
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 |
---|---|---|
|
@@ -154,3 +154,5 @@ cython_debug/ | |
|
||
# PyCharm | ||
.idea/ | ||
.devcontainer/config/* | ||
!.devcontainer/config/configuration.yaml |
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,29 +1,11 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run Home Assistant on port 9123", | ||
"type": "shell", | ||
"command": "container start", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Run Home Assistant configuration against /config", | ||
"type": "shell", | ||
"command": "container check", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Upgrade Home Assistant to latest dev", | ||
"type": "shell", | ||
"command": "container install", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Install a specific version of Home Assistant", | ||
"type": "shell", | ||
"command": "container set-version", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run Home Assistant on port 8123", | ||
"type": "shell", | ||
"command": "poetry run .devcontainer/hass.sh", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |