Skip to content

Commit

Permalink
Add devcontainer definition (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
tetele authored Jan 10, 2025
1 parent 88e2d61 commit 7f5654b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "tetele/onju-voice-satellite",
"image": "ghcr.io/esphome/esphome:latest",
"mounts": [
"source=${localWorkspaceFolder}/esphome,target=/config,type=bind,consistency=cached",
"source=/etc/localtime,target=/etc/localtime,readonly,type=bind"
],
"containerEnv": {
"DEVCONTAINER": "1",
"PIP_BREAK_SYSTEM_PACKAGES": "1",
"PIP_ROOT_USER_ACTION": "ignore"
},
"runArgs": [
"--privileged",
"-e",
"ESPHOME_DASHBOARD_USE_PING=1"
// uncomment and edit the path in order to pass though local USB serial to the conatiner
// , "--device=/dev/ttyACM0"
],
"appPort": 6052,
// if you are using avahi in the host device, uncomment these to allow the
// devcontainer to find devices via mdns
//"mounts": [
// "type=bind,source=/dev/bus/usb,target=/dev/bus/usb",
// "type=bind,source=/var/run/dbus,target=/var/run/dbus",
// "type=bind,source=/var/run/avahi-daemon/socket,target=/var/run/avahi-daemon/socket"
//],

"customizations": {
"vscode": {
"extensions": [
// yaml
"redhat.vscode-yaml",
// editorconfig
"editorconfig.editorconfig"
],
"settings": {
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"terminal.integrated.defaultProfile.linux": "bash",
"yaml.customTags": [
"!secret scalar",
"!lambda scalar",
"!extend scalar",
"!remove scalar",
"!include_dir_named scalar",
"!include_dir_list scalar",
"!include_dir_merge_list scalar",
"!include_dir_merge_named scalar"
],
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.pyc": {
"when": "$(basename).py"
},
"**/__pycache__": true
},
"files.associations": {
"**/.vscode/*.json": "jsonc"
}
}
}
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

# general
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

# YAML
[*.{yaml,yml}]
indent_style = space
indent_size = 2
quote_type = double
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.pio
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing to the Onju Voice Satellite project

The easiest way to contribute to this config is to set up a development environment. The recommended such environment is VSCode with devcontainers.

1. Fork this repo
1. Open up VSCode and invoke the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P`)
1. Use the `Clone repository in container volume...` command and provide your own fork as the repo

Once the repo is cloned, an automated process will set up a development version of ESPHome which you can use in CLI mode.

Modify the config and use commands such as `esphome compile /config/onju-voice.yaml` to generate the corresponding firmware.
5 changes: 5 additions & 0 deletions esphome/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml

0 comments on commit 7f5654b

Please sign in to comment.