mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-08-03 22:47:42 +00:00
Improve Add-On testing steps (#705)
This commit is contained in:
parent
ece4c470bc
commit
2330150835
@ -2,15 +2,27 @@
|
||||
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 devcontainer 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. Just follow the instructions to download and install the [Remote Containers][remote-containers] VS Code extension, 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'). For standalone add-ons, there also exists an [addon devcontainer template][hassio-addon-devcontainer] on GitHub which provides the same boilerplate devcontainer for new add-on projects.
|
||||
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.
|
||||
|
||||
Once running, 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/`.
|
||||
- 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.
|
||||
- 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/`.
|
||||
- The add-on(s) found in your root folder will automatically be found in the Local Add-ons repository.
|
||||
|
||||
The add-on(s) under development will be automatically 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.
|
||||
|
||||
[hassio-addons]: https://github.com/home-assistant/hassio-addons
|
||||
[remote-containers]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers
|
||||
[hassio-addon-devcontainer]: https://github.com/issacg/hassio-addon-devcontainer
|
||||
[hassio-addon-devcontainer]: https://github.com/issacg/hassio-addon-devcontainer
|
||||
|
||||
:::info
|
||||
|
||||
The bootstrap script `start_supervisor.sh` currently does not support Docker on Windows using the WSL 2 based engine. The message "_Timeout while waiting for docker to come up_" will appear in the terminal.
|
||||
|
||||
If you are using Docker Desktop and have Hyper-V support, you can switch back to legacy Hyper-V backend in Settings > General.
|
||||
:::
|
||||
|
||||
## Remote development
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user