Modernize dev environment
This commit is contained in:
parent
862b93a175
commit
11dc0de087
40
.devcontainer/devcontainer.json
Normal file
40
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "hass-browser_mod Dev",
|
||||||
|
"image": "thomasloven/hass-custom-devcontainer",
|
||||||
|
"postCreateCommand": "sudo -E container setup-dev && npm add",
|
||||||
|
"containerEnv": {
|
||||||
|
"DEVCONTAINER": "1"
|
||||||
|
},
|
||||||
|
"forwardPorts": [8123],
|
||||||
|
"mounts": [
|
||||||
|
"source=${localWorkspaceFolder},target=/config/www/workspace,type=bind",
|
||||||
|
"source=${localWorkspaceFolder}/test,target=/config/test,type=bind",
|
||||||
|
"source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind",
|
||||||
|
"source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind"
|
||||||
|
],
|
||||||
|
"runArgs": ["--env-file", "${localWorkspaceFolder}/test/.env"],
|
||||||
|
"extensions": [
|
||||||
|
"github.vscode-pull-request-github",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"spmeesseman.vscode-taskexplorer",
|
||||||
|
"ms-python.python"
|
||||||
|
],
|
||||||
|
"settings": {
|
||||||
|
"files.eol": "\n",
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.formatOnPaste": false,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnType": true,
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
|
"python.linting.pylintEnabled": false,
|
||||||
|
"python.linting.flake8Enabled": true,
|
||||||
|
"python.linting.enabled": true,
|
||||||
|
"python.formatting.provider": "black"
|
||||||
|
}
|
||||||
|
}
|
@ -11,17 +11,13 @@ browser_mod:
|
|||||||
fully:
|
fully:
|
||||||
force_stay_awake: true
|
force_stay_awake: true
|
||||||
|
|
||||||
|
|
||||||
lovelace:
|
lovelace:
|
||||||
mode: yaml
|
mode: storage
|
||||||
resources:
|
|
||||||
- url: /local/card-mod.js
|
|
||||||
type: module
|
|
||||||
dashboards:
|
dashboards:
|
||||||
lovelace-yaml:
|
lovelace-yaml:
|
||||||
mode: yaml
|
mode: yaml
|
||||||
title: yaml
|
title: yaml
|
||||||
filename: lovelace.yaml
|
filename: test/lovelace.yaml
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
themes:
|
themes:
|
||||||
@ -37,7 +33,7 @@ frontend:
|
|||||||
|
|
||||||
tts:
|
tts:
|
||||||
- platform: google_translate
|
- platform: google_translate
|
||||||
base_url: !env_var OUT_ADDR
|
# base_url: !env_var OUT_ADDR
|
||||||
|
|
||||||
script:
|
script:
|
||||||
cm_debug:
|
cm_debug:
|
||||||
|
@ -1,61 +1,17 @@
|
|||||||
#
|
version: "3.0"
|
||||||
# Docker services for testing Home Assistant integrations and plugins
|
|
||||||
#
|
|
||||||
# Automaatically sets up configuration adds a user and skips the onboarding
|
|
||||||
#
|
|
||||||
# Username: dev
|
|
||||||
# Password: dev
|
|
||||||
#
|
|
||||||
# Two services, 'prod' and 'dev' run the latest production and dev docker images respectively.
|
|
||||||
#
|
|
||||||
# Start with
|
|
||||||
# $ docker-compose up prod
|
|
||||||
# or
|
|
||||||
# $ docker-compose up dev
|
|
||||||
#
|
|
||||||
# When done, clean up with
|
|
||||||
# $ docker-compose rm -f
|
|
||||||
#
|
|
||||||
|
|
||||||
x-files: &x-files
|
|
||||||
- ../custom_components:/config/custom_components
|
|
||||||
- ./configuration.yaml:/config/configuration.yaml
|
|
||||||
- ./lovelace.yaml:/config/lovelace.yaml
|
|
||||||
- ./views:/config/views
|
|
||||||
|
|
||||||
x-command: &x-command |
|
|
||||||
bash -c '
|
|
||||||
mkdir /config/www/
|
|
||||||
curl https://raw.githubusercontent.com/thomasloven/lovelace-card-mod/master/card-mod.js --output /config/www/card-mod.js &&
|
|
||||||
hass --script ensure_config -c /config &&
|
|
||||||
hass --script auth -c /config add dev dev &&
|
|
||||||
echo "
|
|
||||||
{
|
|
||||||
\"data\": {
|
|
||||||
\"done\": [
|
|
||||||
\"user\",
|
|
||||||
\"core_config\",
|
|
||||||
\"integration\"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
\"key\": \"onboarding\",
|
|
||||||
\"version\": 3
|
|
||||||
}
|
|
||||||
" > /config/.storage/onboarding &&
|
|
||||||
hass -v -c /config'
|
|
||||||
|
|
||||||
version: '3.5'
|
|
||||||
services:
|
services:
|
||||||
|
test:
|
||||||
prod: &base_service
|
image: thomasloven/hass-custom-devcontainer
|
||||||
image: homeassistant/home-assistant:latest
|
|
||||||
volumes: *x-files
|
|
||||||
ports:
|
|
||||||
- "5001:8123"
|
|
||||||
environment:
|
environment:
|
||||||
OUT_ADDR: "http://${DOCKER_GATEWAY_HOST:-localhost}:5001"
|
- HASS_USERNAME
|
||||||
command: *x-command
|
- HASS_PASSWORD
|
||||||
|
- LOVELACE_LOCAL_FILES
|
||||||
dev:
|
- LOVELACE_PLUGINS
|
||||||
<<: *base_service
|
volumes:
|
||||||
image: homeassistant/home-assistant:dev
|
- ./configuration.yaml:/config/configuration.yaml:ro
|
||||||
|
- .:/config/test:ro
|
||||||
|
- ..:/config/www/workspace
|
||||||
|
- ../custom_components:/config/custom_components
|
||||||
|
ports:
|
||||||
|
- 8125:8123
|
||||||
|
Loading…
x
Reference in New Issue
Block a user