Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VSCode dev tasks #107

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"-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"
, "--device=/dev/ttyACM0"
],
"appPort": 6052,
// if you are using avahi in the host device, uncomment these to allow the
Expand All @@ -32,7 +32,9 @@
// yaml
"redhat.vscode-yaml",
// editorconfig
"editorconfig.editorconfig"
"editorconfig.editorconfig",
// shellcommand.execute
"augustocdias.tasks-shell-input"
],
"settings": {
"editor.formatOnPaste": false,
Expand Down
69 changes: 69 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run dashboard",
"type": "shell",
"command": "esphome",
"args": [
"dashboard",
"/config"
],
"problemMatcher": []
},
{
"label": "Compile current config",
"type": "shell",
"command": "esphome",
"args": [
"compile",
"/config/${fileBasename}"
],
"problemMatcher": []
},
{
"label": "Upload current config",
"type": "shell",
"command": "esphome",
"args": [
"upload",
"--device",
"${input:serial_port}",
"/config/${fileBasename}"
],
"problemMatcher": []
},
{
"label": "Upload current config and start logs",
"type": "shell",
"command": "esphome upload --device ${input:serial_port} /config/${fileBasename} && esphome logs --device ${input:serial_port} /config/${fileBasename}",
"problemMatcher": []
},
{
"label": "Start logs for current config",
"type": "shell",
"command": "esphome",
"args": [
"logs",
"--device",
"${input:serial_port}",
"/config/${fileBasename}"
],
"problemMatcher": []
}
],
"inputs": [
{
"id": "serial_port",
"type": "command",
"command": "shellCommand.execute",
"args": {
// gets all handlers which match /dev/ttyACM* via sed 's/^\(.*\)\(/dev/tty.*\)$/\2/g' -
"command": "ls -la /dev/ttyACM* | sed 's/^\\(.*\\)\\(\\/dev\\/tty.*\\)$/\\2/g' -",
"description": "Select the USB port to upload to"
}
}
]
}
Loading