Skip to content

Commit

Permalink
Bump TheengsGateway to v0.9.0 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile authored Mar 28, 2023
1 parent b51f7d6 commit c20505d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.8.0.1
VERSION=0.9.0.1
NON_INTERACTIVE=false
BUILDX=true
BUILDX_PURGE=false
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL ["/bin/bash", "-ec"]
RUN apt update && apt install --no-install-recommends -y bluez build-essential
RUN python3 -m venv /opt/venv && \
source /opt/venv/bin/activate && \
pip install --upgrade --extra-index-url=https://www.piwheels.org/simple pip TheengsGateway==0.8.0
pip install --upgrade --extra-index-url=https://www.piwheels.org/simple pip TheengsGateway==0.9.0

COPY chroot /

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ services:
MQTT_PASSWORD: <password>
MQTT_PUB_TOPIC: home/TheengsGateway/BTtoMQTT
MQTT_SUB_TOPIC: home/+/BTtoMQTT/undecoded
MQTT_PRE_TOPIC: home/presence/TheengsGateway
PRESENCE: false
PUBLISH_ALL: true
TIME_BETWEEN: 60
SCAN_TIME: 60
Expand Down Expand Up @@ -93,6 +95,8 @@ docker run --rm \
-e MQTT_PASSWORD=<password> \
-e MQTT_PUB_TOPIC=home/TheengsGateway/BTtoMQTT \
-e MQTT_SUB_TOPIC=home/+/BTtoMQTT/undecoded \
-e MQTT_PRE_TOPIC=home/presence/TheengsGateway \
-e PRESENCE=false \
-e PUBLISH_ALL=true \
-e TIME_BETWEEN=60 \
-e SCAN_TIME=60 \
Expand Down
9 changes: 9 additions & 0 deletions chroot/opt/venv/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ if hasvalue $PUBLISH_ALL; then
fi
fi

if hasvalue $PRESENCE; then
if ! [[ $PRESENCE =~ (true|false) ]]; then
echo "WARNING : Wrong value for PRESENCE environment variable, will use default - false"
PRESENCE=false
fi
fi

if hasvalue $SCAN_TIME; then
if ! [[ $SCAN_TIME =~ ^[0-9]+$ ]]; then
echo "WARNING : Wrong value for SCAN_TIME environment variable, will use default - 60"
Expand Down Expand Up @@ -132,6 +139,8 @@ cat <<EOF> $CONFIG
"port": ${MQTT_PORT:-1883},
"publish_topic": "${MQTT_PUB_TOPIC:-home/TheengsGateway/BTtoMQTT}",
"subscribe_topic": "${MQTT_SUB_TOPIC:-home/+/BTtoMQTT/undecoded}",
"presence_topic": "${MQTT_PRE_TOPIC:-home/presence/TheengsGateway}",
"presence": ${PRESENCE:-false},
"publish_all": ${PUBLISH_ALL:-true},
"ble_scan_time": ${SCAN_TIME:-60},
"ble_time_between_scans": ${TIME_BETWEEN:-60},
Expand Down
2 changes: 2 additions & 0 deletions examples/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
MQTT_PASSWORD: ubersecretpassword
MQTT_PUB_TOPIC: home/TheengsGateway/BTtoMQTT
MQTT_SUB_TOPIC: home/+/BTtoMQTT/undecoded
MQTT_PRE_TOPIC: home/presence/TheengsGateway
PRESENCE: false
PUBLISH_ALL: true
TIME_BETWEEN: 60
SCAN_TIME: 5
Expand Down

0 comments on commit c20505d

Please sign in to comment.