-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker_compose.sh
executable file
·36 lines (30 loc) · 1.28 KB
/
docker_compose.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/bash
## Testing
# You can start a mosquitto broker and Home Assistant with this integration in it with Docker Compose.
# Make sure Docker is installed and run the `docker_compose.sh` script. This script will completely reset
# the docker image every time, making sure there is a clean environment.
#
# When you run the script, after a while:
# - A browser window will open, if not, browse to http://localhost:8123.
# - Setup Home Assistant with a user and location.
# - Add the MQTT integration, use hostname `mosquitto` (no user/pw required).
# - Add the Button+ integration to test, the MQTT broker should be prefilled.
# - Your terminal will attach to the Home Assistant docker, showing you logs
# - Detach with CTRL + C, the docker images will automatically be stopped.
#
# **Note:** This will allow you to setup a real Button+ device and see if setup works.
# Actual communication with the device will not work unless the broker is reachable from Button+.
docker compose down
rm -rf ha_config/*
rm -rf ha_config/.*
cat > ha_config/configuration.yaml<< EOF
logger:
default: debug
logs:
custom_components.button_plus: debug
EOF
docker compose up -d
sleep 1
open "http://localhost:8123/"
docker compose attach homeassistant # This blocks until you detach with CTRL + C
docker compose down