From 4200e5c32e4d82c657c265015d96a6644ab578dc Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 2 Nov 2019 20:58:04 +0100 Subject: [PATCH] :sparkles: Adds support for ESPHome --- README.md | 33 +++++++++++++++++++ vscode/rootfs/etc/cont-init.d/code-server.sh | 1 + vscode/rootfs/root/.code-server/settings.json | 3 ++ vscode/vscode.extensions | 1 + 4 files changed, 38 insertions(+) diff --git a/README.md b/README.md index 038a38f..9b483c9 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,39 @@ return to the defaults as delivered by this add-on, do the following: 1. Execute the following command in the terminal window: `reset-settings`. 1. Done! +## Using with ESPHome + +The add-on has support for ESPHome (and its vscode extension), built-in! +It has been installed and pre-configured for you, however, it might need +an adjustment to your ESPHome add-on in order to function. + +1. Go to the ESPHome add-on configuration in your Hass.io panel. +1. Add the `leave_front_door_open` option, since the vscode extension of + ESPHome does not support authentication yet. The ESPHome add-on + configuration would look like this: + + ```json + { + "leave_front_door_open": true + } + ``` + +1. Save the add-on configuration. +1. Enable direct access to the ESPHome add-on, but enabling the network port. + This option can be found on the ESPHome add-on settings page, in the + "Network" section. In the "Host" field (that is now showing disabled), + enter `6052` and hit save. +1. Restart the ESPHome add-on. + +And you're set! + +No changes to the vscode add-on are needed, since it has been pre-configured. + +**Please note!** This opens up ESPHome for access within your network +without authentication! Currently, this is how ESPHome advises how to +set up your system, but it surely has security risks. We hope ESPHome +will come up with a better solution for this soon. + ## Known issues and limitations - This add-on currently only supports AMD64 machines, although we hope diff --git a/vscode/rootfs/etc/cont-init.d/code-server.sh b/vscode/rootfs/etc/cont-init.d/code-server.sh index ea87d0f..ead0838 100644 --- a/vscode/rootfs/etc/cont-init.d/code-server.sh +++ b/vscode/rootfs/etc/cont-init.d/code-server.sh @@ -10,6 +10,7 @@ readonly -a PREVIOUS_DEFAULT_CONFIG_HASHES=( 2be4c50575c05711d30121c3a1320698d3dbb034523c481be3aad3b638af3e0a46113d8c3f8cfc1b0f01e4cc10f32da3a30feca161c31b5b27177aeb7231bf70 d4745002643a0168f65bc5b465a9baff59af0fb4783b50553e1a4e8b3f1a569fc4905df19b7743f7f313a5809a5128d997fc4b5e0a0e5db0a01f47b3b7bec39d 6ed36f832778926fa614fc12eec97b8f813bbb1a04f709769c9e5f54bc8e3cfc05a110155921a3b2ae47fc8389d24fa2bd385e4ce5a6c94850813791a6ac1c82 + 944d9ba57968666353df7e9dc78ec5d94b9b052e1abf863b51bc1f372d9f35cb2d93259f153e9ab3b3dd1b520bfcd7bddb54803bcfd9eb65975ae8fb5553663c ) # Ensure persistent data folder exists. diff --git a/vscode/rootfs/root/.code-server/settings.json b/vscode/rootfs/root/.code-server/settings.json index cac028a..7d36e8b 100644 --- a/vscode/rootfs/root/.code-server/settings.json +++ b/vscode/rootfs/root/.code-server/settings.json @@ -2,6 +2,7 @@ "editor.renderWhitespace": "boundary", "files.associations": { "*.dash": "yaml", + "**/esphome/*.yaml": "yaml", "*.yaml": "home-assistant" }, "files.watcherExclude": { @@ -46,6 +47,8 @@ } }, "terminal.integrated.shell.linux": "/usr/bin/zsh", + "esphome.validator": "dashboard", + "esphome.dashboardUri": "15ef4d2f-esphome.local.hass.io:6052", "workbench.iconTheme": "vscode-icons", "vsicons.dontShowNewVersionMessage": true } diff --git a/vscode/vscode.extensions b/vscode/vscode.extensions index f3cedbc..228337f 100644 --- a/vscode/vscode.extensions +++ b/vscode/vscode.extensions @@ -1,4 +1,5 @@ emilast.LogFileHighlighter#2.6.0 +ESPHome.esphome-vscode#0.2.0 keesschollaart.vscode-home-assistant#1.3.0 lukas-tr.materialdesignicons-intellisense#1.5.6 oderwat.indent-rainbow#7.4.0