|
1 | | -// See https://aka.ms/vscode-remote/devcontainer.json for format details. |
2 | 1 | { |
3 | | - //"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye", |
| 2 | + "name": "HA ha_integration_domain Dev Container", |
4 | 3 | "build": { |
5 | | - "dockerfile": "Dockerfile" |
| 4 | + "dockerfile": "Dockerfile", |
| 5 | + "context": "." |
| 6 | + }, |
| 7 | + "postCreateCommand": "bash .devcontainer/setup-shell.sh && bash .devcontainer/setup-git.sh && script/setup/setup", |
| 8 | + "postAttachCommand": "bash .devcontainer/post-attach.sh", |
| 9 | + "containerEnv": { |
| 10 | + // Home Assistant version to install in the devcontainer. |
| 11 | + // Uncomment and set a specific version if needed (e.g., "2025.12.3"). |
| 12 | + // If not set, defaults to version from hacs.json. |
| 13 | + // "HA_VERSION": "2025.12.3", |
| 14 | + // Install HACS in the Home Assistant installation |
| 15 | + "HA_INSTALL_HACS": "1", |
| 16 | + // Enable asyncio debug mode for easier debugging of async code |
| 17 | + "PYTHONASYNCIODEBUG": "1", |
| 18 | + // Ensure Python output is sent straight to terminal (e.g. for logging) |
| 19 | + "PYTHONUNBUFFERED": "1", |
| 20 | + // Prevent Python from writing .pyc files to disk |
| 21 | + "PYTHONDONTWRITEBYTECODE": "1", |
| 22 | + // Optionally update apt package lists after container creation |
| 23 | + "APT_UPDATE": "0" |
6 | 24 | }, |
7 | | - "name": "tapo integration development", |
8 | | - "appPort": ["9123:8123"], |
9 | | - "containerUser": "root", |
10 | | - "postCreateCommand": "uv sync --group dev", |
11 | | - "containerEnv": { "DEVCONTAINER": "1" }, |
12 | | - "capAdd": ["CAP_NET_RAW", "CAP_NET_BROADCAST", "CAP_NET_BIND_SERVICE"], |
13 | | - "runArgs": ["--network=bridge"], |
14 | 25 | "features": { |
15 | 26 | "ghcr.io/devcontainers/features/node:1": { |
16 | 27 | "version": "lts" |
|
20 | 31 | "packages": ["ffmpeg", "libturbojpeg0", "libpcap-dev"] |
21 | 32 | } |
22 | 33 | }, |
| 34 | + "forwardPorts": [8123], |
| 35 | + "portsAttributes": { |
| 36 | + "8123": { |
| 37 | + "label": "Home Assistant", |
| 38 | + "onAutoForward": "notify" |
| 39 | + } |
| 40 | + }, |
23 | 41 | "customizations": { |
24 | 42 | "vscode": { |
25 | 43 | "extensions": [ |
|
34 | 52 | "ms-vscode-remote.remote-containers", |
35 | 53 | "redhat.vscode-yaml" |
36 | 54 | ], |
| 55 | + // Please keep this file in sync with settings in .vscode/settings.default.jsonc |
37 | 56 | "settings": { |
38 | | - "files.eol": "\n", |
| 57 | + "chat.promptFiles": true, |
39 | 58 | "editor.tabSize": 4, |
40 | | - "terminal.integrated.shell.linux": "/bin/bash", |
41 | | - "python.defaultInterpreterPath": "${containerWorkspaceFolder}/.venv/bin/python", |
42 | | - "python.analysis.autoSearchPaths": false, |
43 | | - "python.linting.pylintEnabled": true, |
44 | | - "python.linting.enabled": true, |
45 | 59 | "editor.formatOnPaste": false, |
46 | 60 | "editor.formatOnSave": true, |
47 | | - "editor.formatOnType": true, |
| 61 | + "editor.formatOnType": false, |
| 62 | + "files.eol": "\n", |
48 | 63 | "files.trimTrailingWhitespace": true, |
49 | | - "python.testing.pytestArgs": ["tests", "--no-cov"], |
50 | | - "python.testing.unittestEnabled": false, |
51 | | - "python.testing.pytestEnabled": true, |
52 | | - "python.testing.pytestPath": "${containerWorkspaceFolder}/.venv/bin/pytest", |
| 64 | + "files.associations": { |
| 65 | + "**/translations/*.json": "jsontranslation" |
| 66 | + }, |
| 67 | + "markdown.validate.enabled": false, |
| 68 | + "markdown.validate.fileLinks.enabled": "ignore", |
| 69 | + "markdown.validate.fragmentLinks.enabled": "ignore", |
| 70 | + "python.analysis.autoImportCompletions": true, |
| 71 | + "python.analysis.diagnosticMode": "workspace", |
| 72 | + "python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python", |
| 73 | + "python.linting.pylintEnabled": false, |
| 74 | + "python.terminal.activateEnvironment": true, |
| 75 | + "python.terminal.activateEnvInCurrentTerminal": true, |
| 76 | + "python.testing.pytestArgs": ["--no-cov"], |
| 77 | + "terminal.integrated.profiles.linux": { |
| 78 | + "zsh": { |
| 79 | + "path": "/usr/bin/zsh" |
| 80 | + } |
| 81 | + }, |
| 82 | + "terminal.integrated.defaultProfile.linux": "zsh", |
| 83 | + "yaml.customTags": [ |
| 84 | + "!secret scalar", |
| 85 | + "!include scalar", |
| 86 | + "!include_dir_list scalar", |
| 87 | + "!include_dir_merge_list scalar", |
| 88 | + "!include_dir_named scalar", |
| 89 | + "!include_dir_merge_named scalar", |
| 90 | + "!input scalar" |
| 91 | + ], |
53 | 92 | "[python]": { |
54 | 93 | "editor.defaultFormatter": "charliermarsh.ruff", |
55 | 94 | "editor.codeActionsOnSave": { |
|
72 | 111 | "[jsontranslation]": { |
73 | 112 | "editor.defaultFormatter": "esbenp.prettier-vscode", |
74 | 113 | "editor.formatOnSave": false |
75 | | - } |
| 114 | + }, |
| 115 | + "json.schemas": [ |
| 116 | + { |
| 117 | + "fileMatch": ["custom_components/*/manifest.json"], |
| 118 | + "url": "${containerWorkspaceFolder}/schemas/json/manifest_schema.json" |
| 119 | + }, |
| 120 | + { |
| 121 | + "fileMatch": ["custom_components/*/translations/*.json"], |
| 122 | + "url": "${containerWorkspaceFolder}/schemas/json/translation_schema.json" |
| 123 | + }, |
| 124 | + { |
| 125 | + "fileMatch": ["hacs.json"], |
| 126 | + "url": "${containerWorkspaceFolder}/schemas/json/hacs_schema.json" |
| 127 | + }, |
| 128 | + { |
| 129 | + "fileMatch": ["custom_components/*/icons.json"], |
| 130 | + "url": "${containerWorkspaceFolder}/schemas/json/icons_schema.json" |
| 131 | + } |
| 132 | + ] |
76 | 133 | } |
77 | 134 | } |
78 | | - } |
| 135 | + }, |
| 136 | + "mounts": [ |
| 137 | + // Mount host gitconfig for local development (ignored in Codespaces) |
| 138 | + // In Codespaces, GitHub automatically configures Git with your account |
| 139 | + "source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig.host,type=bind,consistency=cached,readonly" |
| 140 | + ], |
| 141 | + "remoteUser": "vscode" |
79 | 142 | } |
0 commit comments