Skip to content

Commit

Permalink
feat: provide HA instance via compose.yaml (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
palazzem authored Dec 1, 2023
1 parent 6c4e308 commit 222804c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Home Assistant configuration
config/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 222804c

Please sign in to comment.