diff --git a/.gitignore b/.gitignore index 09e0029..ec31ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Home Assistant configuration +config/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index a873a0d..dbd4c90 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,22 @@ pip install -e '.[all]' pre-commit install ``` +### Testing Changes in Home Assistant + +To test your changes in an actual Home Assistant environment, you may use the Docker container available in our +`compose.yaml` file. Launch the container with the following command: + +```bash +docker compose up -d +``` + +Then, navigate to `http://localhost:8123` in your web browser to set up your Home Assistant instance. Follow the standard +procedure to install the integration, as you would in a typical installation. + +The container is configured to automatically mount the `custom_components/` and `config/` directories from your local +workspace. To see changes reflected in Home Assistant, make sure to restart the instance through the UI each time +you update the integration. + ### Coding Guidelines To maintain a consistent codebase, we utilize [flake8][1] and [black][2]. Consistency is crucial as it diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..939e268 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,13 @@ +version: '3.9' + +services: + homeassistant: + container_name: hass-dev + image: "ghcr.io/home-assistant/home-assistant:stable" + volumes: + - ${PWD}/config:/config + - ${PWD}/custom_components:/config/custom_components + - /etc/localtime:/etc/localtime:ro + - /run/dbus:/run/dbus:ro + ports: + - "127.0.0.1:8123:8123"