Add test script for thingclasses

This commit is contained in:
Simon Stürz 2025-08-19 15:48:28 +02:00
parent d71ce85f12
commit 173c318dd3
2 changed files with 22 additions and 1 deletions

View File

@ -235,7 +235,7 @@ int main(int argc, char *argv[])
// If running in a snappy environment, print out some details about it.
if (!qgetenv("SNAP").isEmpty()) {
if (!qEnvironmentVariableIsEmpty("SNAP")) {
// Note: http://snapcraft.io/docs/reference/env
qCInfo(dcApplication()) << "Snap name :" << qgetenv("SNAP_NAME");
qCInfo(dcApplication()) << "Snap version :" << qgetenv("SNAP_VERSION");

View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ -z $1 ]; then
echo "usage: $0 host <token>"
exit 1
fi
if [ -z $2 ]; then
cat <<EOD | nc $1 2223
{"id":0, "method":"JSONRPC.Hello"}
{"id":1, "method":"Integrations.GetThingClasses"}
EOD
exit 0
fi
cat <<EOD | nc $1 2222
{"id":0, "method":"JSONRPC.Hello"}
{"id":1, "token": "$2", "method":"Integrations.GetThingClasses"}
EOD