Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Identities and Bindkeys #11

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading