From 411ea16668d1b0257ff842befcd1ec0dfd8027c6 Mon Sep 17 00:00:00 2001 From: Oncleben31 Date: Sun, 3 May 2020 09:50:31 +0200 Subject: [PATCH] Minor updates (#26) * link correction in README.md and info.md * Add READMME.md for .devcontainer * Add automation.yaml file in the configuration * Complete CONTRIBUTING.md --- .devcontainer/README.md | 43 ++++++++++++++++++++++++++++++++ .devcontainer/configuration.yaml | 6 ++++- CONTRIBUTING.md | 15 +++++++++-- README.md | 2 +- info.md | 2 +- 5 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 .devcontainer/README.md diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000..752c007 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,43 @@ +## 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 updating the `./devcontainer/configuration.yaml` file. + +**Prerequisites** + +- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +- Docker + - For Linux, macOS, or Windows 10 Pro/Enterprise/Education use the [current release version of Docker](https://docs.docker.com/install/) + - Windows 10 Home requires [WSL 2](https://docs.microsoft.com/windows/wsl/wsl2-install) and the current Edge version of Docker Desktop (see instructions [here](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)). This can also be used for Windows Pro/Enterprise/Education. +- [Visual Studio code](https://code.visualstudio.com/) +- [Remote - Containers (VSC Extension)][extension-link] + +[More info about requirements and devcontainer in general](https://code.visualstudio.com/docs/remote/containers#_getting-started) + +[extension-link]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers + +**Getting started:** + +1. Fork the repository. +2. Clone the repository to your computer. +3. Open the repository using Visual Studio code. + +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. diff --git a/.devcontainer/configuration.yaml b/.devcontainer/configuration.yaml index e693ddc..43100eb 100644 --- a/.devcontainer/configuration.yaml +++ b/.devcontainer/configuration.yaml @@ -1,5 +1,9 @@ default_config: + +automation: !include automations.yaml + logger: default: error logs: - custom_components.blueprint: debug \ No newline at end of file + custom_components.blueprint: debug + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f291aca..b77c86a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,8 @@ Pull requests are the best way to propose changes to the codebase. 1. Fork the repo and create your branch from `master`. 2. If you've changed something, update the documentation. 3. Make sure your code lints (using black). -4. Issue that pull request! +4. Test you contribution. +5. Issue that pull request! ## Any contributions you make will be under the MIT Software License @@ -24,7 +25,7 @@ In short, when you submit code changes, your submissions are understood to be un ## Report bugs using Github's [issues](../../issues) -GitHub issues are used to track public bugs. +GitHub issues are used to track public bugs. Report a bug by [opening a new issue](../../issues/new/choose); it's that easy! ## Write bug reports with detail, background, and sample code @@ -45,6 +46,16 @@ People *love* thorough bug reports. I'm not even kidding. Use [black](https://github.com/ambv/black) to make sure the code follows the style. +## Test your code modification + +This custom component is based on [blueprint template](https://github.com/custom-components/blueprint). + +It comes with development environement in a container, easy to launch +if you use Visual Studio Code. With this container you will have a stand alone +Home Assistant instance running and already configured with the included +[`.devcontainer/configuration.yaml`](https://github.com/oncleben31/ha-pool_pump/blob/master/.devcontainer/configuration.yaml) +file. + ## License By contributing, you agree that your contributions will be licensed under its MIT License. diff --git a/README.md b/README.md index 5f9716a..e2ceafc 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ README content if this was a published component: [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] -[![License][license-shield]](LICENSE.md) +[![License][license-shield]](LICENSE) [![hacs][hacsbadge]][hacs] ![Project Maintenance][maintenance-shield] diff --git a/info.md b/info.md index e4a2094..4a097f5 100644 --- a/info.md +++ b/info.md @@ -1,6 +1,6 @@ [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] -[![License][license-shield]](LICENSE.md) +[![License][license-shield]](LICENSE) [![hacs][hacsbadge]](hacs) ![Project Maintenance][maintenance-shield]