Skip to content

Commit

Permalink
Add Identities and Bindkeys (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
1technophile authored Dec 13, 2023
1 parent 38291d7 commit 2668b1e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ You can use following command to run if you don't have docker compose plugin ins
docker run --rm \
--network host \
--privileged \
--restart always \
-e MQTT_HOST=<host_ip> \
-e MQTT_USERNAME=<username> \
-e MQTT_PASSWORD=<password> \
Expand All @@ -118,6 +119,8 @@ docker run --rm \
-e ADAPTER=hci0 \
-e TIME_SYNC="[]" \
-e TIME_FORMAT=0 \
-e IDENTITIES="{\"00:11:22:33:44:55:66\":\"0dc540f3025b474b9ef1085e051b1add\",\"AA:BB:CC:DD:EE:FF\":\"6385424e1b0341109942ad2a6bb42e58\"}" \
-e BINDKEYS="{\"00:11:22:33:44:55:66\":\"0dc540f3025b474b9ef1085e051b1add\",\"AA:BB:CC:DD:EE:FF\":\"6385424e1b0341109942ad2a6bb42e58\"}" \
-v /var/run/dbus:/var/run/dbus \
--name theengsgateway \
theengs/gateway-ARCH:latest
Expand Down
18 changes: 16 additions & 2 deletions chroot/opt/venv/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ fi
cd $VIRTUAL_ENV

echo "Creating config at $CONFIG ..."
cat <<EOF> $CONFIG
{
cat <<EOF
{
"host": "$MQTT_HOST",
"pass": "$MQTT_PASSWORD",
Expand All @@ -178,8 +179,21 @@ cat <<EOF> $CONFIG
"time_format": "${TIME_FORMAT:-0}",
"enable_tls": ${ENABLE_TLS:-false},
"enable_websocket": ${ENABLE_WEBSOCKET:-false}
}
EOF
# Conditionally include IDENTITIES if not empty
if [ -n "$IDENTITIES" ]; then
echo ", \"identities\": $IDENTITIES"
fi

# Conditionally include BINDKEYS if not empty
if [ -n "$BINDKEYS" ]; then
echo ", \"bindkeys\": $BINDKEYS"
fi

echo "}"
} > $CONFIG

cat $CONFIG


python3 -m TheengsGateway $PARAMS

0 comments on commit 2668b1e

Please sign in to comment.