mirror of
https://github.com/natekspencer/hacs-oasis_mini.git
synced 2025-11-18 01:53:41 -05:00
Initial commit
This commit is contained in:
35
.devcontainer/README.md
Normal file
35
.devcontainer/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
## 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 component code. You can configure this instance by updating the `./config/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`._
|
||||
|
||||
### Step by Step debugging
|
||||
|
||||
With the development container,
|
||||
you can test your custom component in Home Assistant with step by step debugging.
|
||||
|
||||
Launch the debugger with the existing debugging configuration `Home Assistant`.
|
||||
37
.devcontainer/devcontainer.json
Normal file
37
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,37 @@
|
||||
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
|
||||
{
|
||||
"name": "Home Assistant integration development",
|
||||
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
|
||||
"postCreateCommand": "sudo apt-get update && sudo apt-get install libturbojpeg0",
|
||||
"postAttachCommand": ".devcontainer/setup",
|
||||
"forwardPorts": [8123],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"ms-python.vscode-pylance",
|
||||
"esbenp.prettier-vscode",
|
||||
"github.vscode-pull-request-github",
|
||||
"ryanluker.vscode-coverage-gutters",
|
||||
"charliermarsh.ruff"
|
||||
],
|
||||
"settings": {
|
||||
"files.eol": "\n",
|
||||
"editor.tabSize": 4,
|
||||
"python.pythonPath": "/usr/bin/python3",
|
||||
"python.analysis.autoSearchPaths": false,
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.formatOnType": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "always"
|
||||
},
|
||||
"files.trimTrailingWhitespace": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"remoteUser": "vscode",
|
||||
"features": {
|
||||
"rust": "latest"
|
||||
}
|
||||
}
|
||||
9
.devcontainer/setup
Executable file
9
.devcontainer/setup
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
python3 -m pip install --requirement requirements.txt --upgrade
|
||||
|
||||
mkdir -p config
|
||||
Reference in New Issue
Block a user