ha-nicehash/.devcontainer/README.md
Brian Berg 74d9f14439 docs: minor updates
- punctuation
- reference configuration template
- update configuration examples
2020-07-11 21:28:48 +00:00

2.8 KiB

Developing with Visual Studio Code + devcontainer

The easiest way to get started with custom integration development is to use Visual Studio Code with devcontainers. This approach will create a preconfigured development environment with all the tools you need.

In the container you will have a dedicated Home Assistant core instance running with your custom compnent code. You can configure this instance by adding a ./devcontainer/configuration.yaml file.

Prerequisites

More info about requirements and devcontainer in general

Getting started:

  1. Fork the repository.
  2. Clone the repository to your computer.
  3. Open the repository using Visual Studio code.
  4. Copy .devcontainer/configuration.tmpl.yaml to .devcontainer/configuration.yaml and update

When you open this repository with Visual Studio code you are asked to "Reopen in Container", this will start the build of the container.

If you don't see this notification, open the command palette and select Remote-Containers: Reopen Folder in Container.

Tasks

The devcontainter comes with some useful tasks to help you with development, you can start these tasks by opening the command palette and select Tasks: Run Task then select the task you want to run.

When a task is currently running (like Run Home Assistant on port 9123 for the docs), it can be restarted by opening the command palette and selecting Tasks: Restart Running Task, then select the task you want to restart.

The available tasks are:

Task Description
Run Home Assistant on port 9123 Launch Home assistant with your custom compnent code and the configuration defined in .devcontainer/configuration.yaml.
Run Home Assistant configuration against /config Check the configuration.
Upgrade Home Assistant to latest dev Upgrade the Home Assitant core version in the container to the latest version of the dev branch.
Install a spesific version of Home Assistant Install a specific version of Home Assistant core in the container.