Update testing.md (#856)

- Port inside devcontainer.json is 7123 mapped to 8123 so users should be directed to 7123.
- if you don't copy the `.vscode` folder the `Start Home Assistant` task is not available
This commit is contained in:
Sander Cox 2021-03-22 13:53:20 +01:00 committed by GitHub
parent 0d67d551d0
commit 46c9a3702f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,10 +5,10 @@ title: "Local add-on testing"
The fastest and recommended way to develop add-ons is using a local Visual Studio Code dev environment. The [Official Add-ons][hassio-addons] repository includes a dev container setup for VS Code which will run Supervisor and Home Assistant, with all of the add-ons mapped as Local Add-ons inside, making it simple for add-on developers on Windows, Mac and Linux desktop OS-es.
- Follow the instructions to download and install the [Remote Containers][remote-containers] VS Code extension.
- Copy the `.devcontainer` folder from [Official Add-ons][hassio-addons] repository into the root of your add-ons folders.
- Copy the `.devcontainer` and `.vscode` folder from [Official Add-ons][hassio-addons] repository into the root of your add-ons folders.
- Open the root folder inside VS Code, and when prompted re-open the window inside the container (or, from the Command Palette, select 'Rebuild and Reopen in Container').
- When VS Code has opened your folder in the container (which can take some time for the first run) you'll need to run the task (Terminal -> Run Task) 'Start Home Assistant', which will bootstrap Supervisor and Home Assistant.
- You'll then be able to access the normal onboarding process via the Home Assistant instance at `http://localhost:8123/`.
- You'll then be able to access the normal onboarding process via the Home Assistant instance at `http://localhost:7123/`.
- The add-on(s) found in your root folder will automatically be found in the Local Add-ons repository.
For standalone add-ons, there also exists an [addon devcontainer template][hassio-addon-devcontainer] on GitHub which provides the same boilerplate dev container for new add-on projects.