diff --git a/debian/guhd.1 b/debian/guhd.1 index 38fa46df..f7780a5a 100644 --- a/debian/guhd.1 +++ b/debian/guhd.1 @@ -1,6 +1,6 @@ .\" Manpage for guhd. .\" Contact simon.stuerz@guh.guru to correct errors or typos. -.TH man 1 "June 2015" "1.1" "guhd man page" +.TH man 1 "August 2015" "1.2" "guhd man page" .SH NAME guhd \- Server for home automation systems .SH SYNOPSIS @@ -38,11 +38,21 @@ Print the debug messages from the device manager. .IP \fIHardware\fR\ (default\ disabled) Print the debug messages from hardware resources in guh. .IP \fIJsonRpc\fR\ (default\ disabled) -Print the debug messages from JSON-RPC interface. +Print the debug messages from JSON-RPC API. .IP \fILogEngine\fR\ (default\ disabled) Print the debug messages from logging engine. +.IP \fIRest\fR\ (default\ disbaled) +Print the debug messages from REST API. .IP \fIRuleEngine\fR\ (default\ enabled) Print the debug messages from the rule engine. +.IP \fITcpServer\fR\ (default\ disabled) +Print the debug messages from the TCP server. +.IP \fIWarning\fR\ (default\ enabled) +Print warnings. +.IP \fIWebServer\fR\ (default\ enabled) +Print the debug messages from the web server. +.IP \fIWebSocketServer\fR\ (default\ enabled) +Print the debug messages from the websocket server. .TP \fBDebug\ categories\ for\ plugins:\fR Since guh loads the plugins dynamically, the list of supported @@ -58,6 +68,9 @@ To start guhd in the foreground, disable debug messages from the DeviceManager and enable debug messages for JsonRpc and LogEngine: .IP $ guhd -n -d NoDeviceManager JsonRpc LogEngine +.SH FILES +.TP +The settings of the guh server can be found in \fI/etc/guh/guhd.conf\fR .SH SEE ALSO Full developer documentation at: .br diff --git a/doc/guh.qdoc b/doc/guh.qdoc index 8eea0b12..cba2df40 100644 --- a/doc/guh.qdoc +++ b/doc/guh.qdoc @@ -28,6 +28,7 @@ \section2 Quicklinks \list - \li \l{All guh Classes} + \li \l{All guh Classes} + \li \l{All Modules} \endlist */ diff --git a/doc/jsonrpc.qdoc b/doc/jsonrpc.qdoc index 715eb6a2..10e6480b 100644 --- a/doc/jsonrpc.qdoc +++ b/doc/jsonrpc.qdoc @@ -12,7 +12,7 @@ transport channel is not based on HTTP. It is an internal RPC mechanism to allow communication between the guh Server and the main controller interface. This communication socket is not meant to be exported to the outside of the of the systen as it allows arbitrary commands to manipulate - the system. A more limited REST API implementation might be added in the main controller interface. + the system. The JSON message protocol communicates by exchanging JSON Objects with the following properties: \list @@ -34,14 +34,12 @@ Parameters are optional if the type is the type is prefixed with "o:" for optional. \section1 Communicating with the server - The server listens on TCP port 1234 for incoming TCP connections. It will respond to incoming - connections with a some information about the server. Telnet can be used to issue commands for - testing. + The server listens by default on TCP port 2222 for incoming TCP connections. It will respond to incoming connections with a some information about the server. Telnet can be used to issue commands for testing. An example how to communicate with the API using telnet on the same host where the guh server is running: \code - $ telnet localhost 1234 + $ telnet localhost 2222 \endcode \code Trying 127.0.0.1... @@ -49,9 +47,9 @@ Escape character is '^]'. { "id": 0, - "protocol version": 9, + "protocol version": 28, "server": "guh JSONRPC interface", - "version": "0.2.0" + "version": "0.6.0" } \endcode Now the connection is established and waits for commands. @@ -163,7 +161,7 @@ } \endcode - \section1 API Description + \section1 Newest JSON-RPC API \quotefile tests/auto/api.json */ diff --git a/server/main.cpp b/server/main.cpp index f5ef33f5..d659603c 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -62,11 +62,11 @@ int main(int argc, char *argv[]) s_loggingFilters.insert("DeviceManager", true); s_loggingFilters.insert("RuleEngine", true); s_loggingFilters.insert("Connection", true); - s_loggingFilters.insert("TcpServer", true); - s_loggingFilters.insert("WebServer", true); - s_loggingFilters.insert("WebSocketServer", true); + s_loggingFilters.insert("TcpServer", false); + s_loggingFilters.insert("WebServer", false); + s_loggingFilters.insert("WebSocketServer", false); s_loggingFilters.insert("JsonRpc", false); - s_loggingFilters.insert("Rest", true); + s_loggingFilters.insert("Rest", false); s_loggingFilters.insert("Hardware", false); s_loggingFilters.insert("LogEngine", false); diff --git a/tests/scripts/0001-fix-cmdmgr.patch b/tests/scripts/0001-fix-cmdmgr.patch deleted file mode 100644 index 2a1bed4f..00000000 --- a/tests/scripts/0001-fix-cmdmgr.patch +++ /dev/null @@ -1,34 +0,0 @@ -From af93f794e40ebfd342d2bb0b1b050c7b2a6224f5 Mon Sep 17 00:00:00 2001 -From: Michael Zanetti -Date: Fri, 10 Oct 2014 00:19:56 +0200 -Subject: [PATCH] fix cmdmgr - ---- - tests/scripts/cmdmgr.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tests/scripts/cmdmgr.py b/tests/scripts/cmdmgr.py -index da3d430..6930e06 100755 ---- a/tests/scripts/cmdmgr.py -+++ b/tests/scripts/cmdmgr.py -@@ -262,13 +262,13 @@ def add_device(): - print "Empty deviceClass. Can't continue" - return - deviceClass = get_deviceClass(deviceClassId) -- print "createmethod is", deviceClass['createMethod'] -- if deviceClass['createMethod'] == "CreateMethodUser": -+ print "createmethods are", deviceClass['createMethods'] -+ if "CreateMethodUser" in deviceClass['createMethods']: - add_configured_device(deviceClassId) -- elif deviceClass['createMethod'] == "CreateMethodDiscovery": -+ elif "CreateMethodDiscovery" in deviceClass['createMethods']: - deviceDescriptorId = discover_device(deviceClassId) - add_discovered_device(deviceClassId, deviceDescriptorId) -- elif deviceClass['createMethod'] == "CreateMethodAuto": -+ elif "CreateMethodAuto" in deviceClass['createMethods']: - print "Can't create this device manually. It'll be created automatically when hardware is discovered." - - def select_device(): --- -2.1.0 - diff --git a/tests/scripts/0001-fix-some-plugin-s-json.patch b/tests/scripts/0001-fix-some-plugin-s-json.patch deleted file mode 100644 index 22fbd5ad..00000000 --- a/tests/scripts/0001-fix-some-plugin-s-json.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 83d98f475710868cb5c626af43415d94520964f3 Mon Sep 17 00:00:00 2001 -From: Michael Zanetti -Date: Fri, 10 Oct 2014 01:14:39 +0200 -Subject: [PATCH] fix some plugin's json - ---- - libguh/plugin/deviceplugin.cpp | 6 ++++++ - plugins/deviceplugins/lircd/devicepluginlircd.json | 2 +- - .../deviceplugins/openweathermap/devicepluginopenweathermap.json | 8 ++++---- - server/jsonrpc/jsontypes.cpp | 1 + - 4 files changed, 12 insertions(+), 5 deletions(-) - -diff --git a/libguh/plugin/deviceplugin.cpp b/libguh/plugin/deviceplugin.cpp -index a88fd7e..d90ea31 100644 ---- a/libguh/plugin/deviceplugin.cpp -+++ b/libguh/plugin/deviceplugin.cpp -@@ -163,6 +163,7 @@ QList DevicePlugin::supportedDevices() const - deviceClass.setCreateMethods(createMethods); - - deviceClass.setDiscoveryParamTypes(parseParamTypes(jo.value("discoveryParamTypes").toArray())); -+ qDebug() << "loaded deviceClass" << deviceClass.discoveryParamTypes(); - - QString setupMethod = jo.value("setupMethod").toString(); - if (setupMethod == "pushButton") { -@@ -293,6 +294,11 @@ QList DevicePlugin::parseParamTypes(const QJsonArray &array) const - foreach (const QJsonValue ¶mTypesJson, array) { - QJsonObject pt = paramTypesJson.toObject(); - QVariant::Type t = QVariant::nameToType(pt.value("type").toString().toLatin1().data()); -+ Q_ASSERT_X(t != QVariant::Invalid, -+ pluginName().toLatin1().data(), -+ QString("Invalid type %1 for param %2 in json file.") -+ .arg(pt.value("type").toString()) -+ .arg(pt.value("name").toString()).toLatin1().data()); - ParamType paramType(pt.value("name").toString(), t, pt.value("defaultValue").toVariant()); - QVariantList allowedValues; - foreach (const QJsonValue &allowedTypesJson, pt.value("allowedValues").toArray()) { -diff --git a/plugins/deviceplugins/lircd/devicepluginlircd.json b/plugins/deviceplugins/lircd/devicepluginlircd.json -index 0f75dc9..976ab3a 100644 ---- a/plugins/deviceplugins/lircd/devicepluginlircd.json -+++ b/plugins/deviceplugins/lircd/devicepluginlircd.json -@@ -23,7 +23,7 @@ - "paramTypes": [ - { - "name": "button", -- "type": "string" -+ "type": "QString" - }, - { - "name": "repeat", -diff --git a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json -index aac6f81..cdc8e1e 100644 ---- a/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json -+++ b/plugins/deviceplugins/openweathermap/devicepluginopenweathermap.json -@@ -13,21 +13,21 @@ - "discoveryParamTypes": [ - { - "name": "location", -- "type": "string" -+ "type": "QString" - } - ], - "paramTypes": [ - { - "name": "location", -- "type": "string" -+ "type": "QString" - }, - { - "name": "country", -- "type": "string" -+ "type": "QString" - }, - { - "name": "id", -- "type": "string" -+ "type": "QString" - } - ], - "actionTypes": [ -diff --git a/server/jsonrpc/jsontypes.cpp b/server/jsonrpc/jsontypes.cpp -index dc96635..cece93f 100644 ---- a/server/jsonrpc/jsontypes.cpp -+++ b/server/jsonrpc/jsontypes.cpp -@@ -371,6 +371,7 @@ QVariantMap JsonTypes::packDeviceClass(const DeviceClass &deviceClass) - } - QVariantList discoveryParamTypes; - foreach (const ParamType ¶mType, deviceClass.discoveryParamTypes()) { -+ qDebug() << "packing discoverparam" << packParamType(paramType); - discoveryParamTypes.append(packParamType(paramType)); - } - --- -2.1.0 - diff --git a/tests/scripts/addconfigureddevice.sh b/tests/scripts/addconfigureddevice.sh index 19c8b7f6..03c4e2cf 100755 --- a/tests/scripts/addconfigureddevice.sh +++ b/tests/scripts/addconfigureddevice.sh @@ -10,36 +10,36 @@ elif [ -z $2 ]; then else if [ $2 == "elroremote" ]; then # Adds an ELRO remote control on channel 00000 - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{d85c1ef4-197c-4053-8e40-707aa671d302}","deviceParams":{"channel1":"false", "channel2":"false", "channel3":"false", "channel4": "false", "channel5":"false" }}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{d85c1ef4-197c-4053-8e40-707aa671d302}","deviceParams":{"channel1":"false", "channel2":"false", "channel3":"false", "channel4": "false", "channel5":"false" }}}'; sleep 1) | nc $1 2222 elif [ $2 == "elroswitch" ]; then # Adds a ELRO power switch on channel 00000 and group D - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{308ae6e6-38b3-4b3a-a513-3199da2764f8}","deviceParams":{"channel1":"false","channel2":"false", "channel3":"false", "channel4": "false","channel5":"false","A":"true","B":"false","C":"false","D":"false","E":"false" }}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{308ae6e6-38b3-4b3a-a513-3199da2764f8}","deviceParams":{"channel1":"false","channel2":"false", "channel3":"false", "channel4": "false","channel5":"false","A":"true","B":"false","C":"false","D":"false","E":"false" }}}'; sleep 1) | nc $1 2222 elif [ $2 == "intertechnoremote" ]; then # Adds an intertechno remote control - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{ab73ad2f-6594-45a3-9063-8f72d365c5e5}","deviceParams":{"familyCode":"J"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{ab73ad2f-6594-45a3-9063-8f72d365c5e5}","deviceParams":{"familyCode":"J"}}}'; sleep 1) | nc $1 2222 # elif [ $2 == "meisteranker" ]; then # # Adds an intertechno remote control -# (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{e37e9f34-95b9-4a22-ae4f-e8b874eec871}","deviceParams":{"id":"1"}}}'; sleep 1) | nc $1 1234 +# (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{e37e9f34-95b9-4a22-ae4f-e8b874eec871}","deviceParams":{"id":"1"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "wifidetector" ]; then # Adds a WiFi detector - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{bd216356-f1ec-4324-9785-6982d2174e17}","deviceParams":{"mac":"90:cf:15:1b:ce:bb"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{bd216356-f1ec-4324-9785-6982d2174e17}","deviceParams":{"mac":"90:cf:15:1b:ce:bb"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "mock1" ]; then # Adds a Mock device - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{753f0d32-0468-4d08-82ed-1964aab03298}","deviceParams":{"httpport":"8081"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{753f0d32-0468-4d08-82ed-1964aab03298}","deviceParams":{"httpport":"8081"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "mock2" ]; then # Adds a Mock device - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{753f0d32-0468-4d08-82ed-1964aab03298}","deviceParams":{"httpport":"8082"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{753f0d32-0468-4d08-82ed-1964aab03298}","deviceParams":{"httpport":"8082"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "openweathermap" ]; then - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{985195aa-17ad-4530-88a4-cdd753d747d7}","deviceDescriptorId":"'$4'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{985195aa-17ad-4530-88a4-cdd753d747d7}","deviceDescriptorId":"'$4'"}}'; sleep 1) | nc $1 2222 elif [ $2 == "wol" ]; then - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{3c8f2447-dcd0-4882-8c09-99e579e4d24c}","deviceParams":{"mac":"'$3'", "name":"Wohnzimmer-PC"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{3c8f2447-dcd0-4882-8c09-99e579e4d24c}","deviceParams":{"mac":"'$3'", "name":"Wohnzimmer-PC"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "lirc" ]; then - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{5c2bc4cd-ba6c-4052-b6cd-1db83323ea22}","deviceParams":{"remoteName":"'$3'"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{5c2bc4cd-ba6c-4052-b6cd-1db83323ea22}","deviceParams":{"remoteName":"'$3'"}}}'; sleep 1) | nc $1 2222 elif [ $2 == "discovered" ]; then if [ -z $4]; then echo "usage $0 host device [deviceClassId descriptorId]. In case of a discovered device, deviceClassId and descriptorId are mandatory." else - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "'$3'", "deviceDescriptorId": "'$4'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "'$3'", "deviceDescriptorId": "'$4'"}}'; sleep 1) | nc $1 2222 fi else echo "unknown type $2. Possible values are: elroremote, elroswitch, intertechnoremote, wifidetector, mock1, mock2, openweathermap, lirc, discovered. (In case of discovered, a deviceDescriptorId is required)" diff --git a/tests/scripts/addgooglemail.sh b/tests/scripts/addgooglemail.sh index e08c6870..38761acf 100755 --- a/tests/scripts/addgooglemail.sh +++ b/tests/scripts/addgooglemail.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host user password sendTo" else - (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{3869884a-1592-4b8f-84a7-994be18ff555}","deviceParams":{"user":"'$2'", "password":"'$3'", "recipient":"'$4'"}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.AddConfiguredDevice", "params":{"deviceClassId": "{3869884a-1592-4b8f-84a7-994be18ff555}","deviceParams":{"user":"'$2'", "password":"'$3'", "recipient":"'$4'"}}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/addrule.sh b/tests/scripts/addrule.sh index 521019b5..d6129bac 100755 --- a/tests/scripts/addrule.sh +++ b/tests/scripts/addrule.sh @@ -3,10 +3,10 @@ if test -z $5; then echo "usage: $0 host sourceDevice eventTypeId targetDeviceId actionTypeId [paramname paramvalue]" elif test -z $6; then - (echo '{"id":1, "method":"Rules.AddRule", "params":{"eventDescriptor": {"eventTypeId": "'$3'", "deviceId":"'$2'"}, "actions": [ { "deviceId":"'$4'", "actionTypeId":"'$5'"}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Rules.AddRule", "params":{"eventDescriptor": {"eventTypeId": "'$3'", "deviceId":"'$2'"}, "actions": [ { "deviceId":"'$4'", "actionTypeId":"'$5'"}]}}'; sleep 1) | nc $1 2222 elif test -z $7; then echo "usage: $0 host sourceDevice eventTypeId targetDeviceId actionTypeId [paramname paramvalue]" else - (echo '{"id":1, "method":"Rules.AddRule", "params":{"event": {"eventTypeId": "'$3'", "deviceId":"'$2'"}, "actions": [ { "deviceId":"'$4'", "actionTypeId":"'$5'", "params":{"'$6'":"'$7'"}}]}}'; sleep 1) | nc $1 1234 -# (echo '{"id":1, "method":"Rules.AddRule", "params":{"event": {"eventTypeId": "'$2'", "deviceId":"'$3'", "params":{"power":"false"}}, "actions": [ { "deviceId":"'$4'", "name":"rule 1", "params":{"power":"false"}},{ "deviceId":"'$5'", "name":"rule 1", "params":{"power":"true"}}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Rules.AddRule", "params":{"event": {"eventTypeId": "'$3'", "deviceId":"'$2'"}, "actions": [ { "deviceId":"'$4'", "actionTypeId":"'$5'", "params":{"'$6'":"'$7'"}}]}}'; sleep 1) | nc $1 2222 +# (echo '{"id":1, "method":"Rules.AddRule", "params":{"event": {"eventTypeId": "'$2'", "deviceId":"'$3'", "params":{"power":"false"}}, "actions": [ { "deviceId":"'$4'", "name":"rule 1", "params":{"power":"false"}},{ "deviceId":"'$5'", "name":"rule 1", "params":{"power":"true"}}]}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/executeaction.sh b/tests/scripts/executeaction.sh index f53e0cf8..057f4f94 100755 --- a/tests/scripts/executeaction.sh +++ b/tests/scripts/executeaction.sh @@ -3,14 +3,14 @@ if [ -z $3 ]; then echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]" elif [ -z $4 ]; then - (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}"}}'; sleep 1) | nc $1 2222 elif [ -z $5 ]; then echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]" elif [ -z $6 ]; then echo calling.. $4 $5 - (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{ "name": "'$4'", "value":"'$5'"}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{ "name": "'$4'", "value":"'$5'"}]}}'; sleep 1) | nc $1 2222 elif [ -z $7 ]; then echo "usage: $0 host actionTypeId deviceId [paramname paramvalue] [paramname paramvalue]" else - (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{"name": "'$4'", "value":"'$5'"}, {"name": "'$6'", "value": "'$7'"}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{'$2'}", "deviceId":"{'$3'}","params":[{"name": "'$4'", "value":"'$5'"}, {"name": "'$6'", "value": "'$7'"}]}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getactiontype.sh b/tests/scripts/getactiontype.sh index d215f63c..94f8d2be 100755 --- a/tests/scripts/getactiontype.sh +++ b/tests/scripts/getactiontype.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host actionTypeId" else - (echo '{"id":1, "method":"Actions.GetActionType", "params":{"actionTypeId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Actions.GetActionType", "params":{"actionTypeId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getactiontypes.sh b/tests/scripts/getactiontypes.sh index a4a5e710..0557d377 100755 --- a/tests/scripts/getactiontypes.sh +++ b/tests/scripts/getactiontypes.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host deviceClassId" else - (echo '{"id":1, "method":"Devices.GetActionTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetActionTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getconfigureddevices.sh b/tests/scripts/getconfigureddevices.sh index 86058709..1e2dd0b5 100755 --- a/tests/scripts/getconfigureddevices.sh +++ b/tests/scripts/getconfigureddevices.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage: $0 host" else - (echo '{"id":1, "method":"Devices.GetConfiguredDevices"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetConfiguredDevices"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getdiscovereddevices.sh b/tests/scripts/getdiscovereddevices.sh index d1aa7237..39d7d2e1 100755 --- a/tests/scripts/getdiscovereddevices.sh +++ b/tests/scripts/getdiscovereddevices.sh @@ -3,9 +3,9 @@ if [ -z $2 ]; then echo "usage $0 host deviceclassid [paramname paramvalue]" elif [ -z $3 ]; then - (echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'", "discoveryParams": {"location":""}}}'; sleep 6) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'", "discoveryParams": {"location":""}}}'; sleep 6) | nc $1 2222 elif [ -z $4 ]; then echo "usage $0 host deviceclassid [paramname paramvalue]" else - (echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'", "discoveryParams": {"'$3'":"'$4'"}}}'; sleep 6) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetDiscoveredDevices", "params":{"deviceClassId":"'$2'", "discoveryParams": {"'$3'":"'$4'"}}}'; sleep 6) | nc $1 2222 fi diff --git a/tests/scripts/geteventtypes.sh b/tests/scripts/geteventtypes.sh index a8394464..450ef484 100755 --- a/tests/scripts/geteventtypes.sh +++ b/tests/scripts/geteventtypes.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host deviceClassId" else - (echo '{"id":1, "method":"Devices.GetEventTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetEventTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getpluginconfig.sh b/tests/scripts/getpluginconfig.sh index e7ebb2fd..b38c81c6 100755 --- a/tests/scripts/getpluginconfig.sh +++ b/tests/scripts/getpluginconfig.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage $0 host pluginid" else - (echo '{"id":1, "method":"Devices.GetPluginConfiguration", "params":{"pluginId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetPluginConfiguration", "params":{"pluginId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getplugins.sh b/tests/scripts/getplugins.sh index 3a22f218..ab334943 100755 --- a/tests/scripts/getplugins.sh +++ b/tests/scripts/getplugins.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage $0 host" else - (echo '{"id":1, "method":"Devices.GetPlugins"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetPlugins"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getrules.sh b/tests/scripts/getrules.sh index f365f6e8..52c24be5 100755 --- a/tests/scripts/getrules.sh +++ b/tests/scripts/getrules.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage: $0 host" else - (echo '{"id":1, "method":"Rules.GetRules"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Rules.GetRules"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getstatetypes.sh b/tests/scripts/getstatetypes.sh index c99114be..77d85b18 100755 --- a/tests/scripts/getstatetypes.sh +++ b/tests/scripts/getstatetypes.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host deviceClassId" else - (echo '{"id":1, "method":"Devices.GetStateTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetStateTypes", "params":{"deviceClassId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getstatevalue.sh b/tests/scripts/getstatevalue.sh index b80e5d5d..488848da 100755 --- a/tests/scripts/getstatevalue.sh +++ b/tests/scripts/getstatevalue.sh @@ -3,5 +3,5 @@ if [ -z $3 ]; then echo "usage: $0 host deviceId stateTypeId" else - (echo '{"id":1, "method":"Devices.GetStateValue", "params":{"deviceId":"'$2'", "stateTypeId":"'$3'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetStateValue", "params":{"deviceId":"'$2'", "stateTypeId":"'$3'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getsupporteddevices.sh b/tests/scripts/getsupporteddevices.sh index c9533aee..470b234f 100755 --- a/tests/scripts/getsupporteddevices.sh +++ b/tests/scripts/getsupporteddevices.sh @@ -3,7 +3,7 @@ if [ -z $1 ]; then echo "usage $0 host" elif [ -z $2 ]; then - (echo '{"id":1, "method":"Devices.GetSupportedDevices"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetSupportedDevices"}'; sleep 1) | nc $1 2222 else - (echo '{"id":1, "method":"Devices.GetSupportedDevices", "params":{"vendorId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetSupportedDevices", "params":{"vendorId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getsupportedvendors.sh b/tests/scripts/getsupportedvendors.sh index c40e35b9..2188798d 100755 --- a/tests/scripts/getsupportedvendors.sh +++ b/tests/scripts/getsupportedvendors.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage $0 host" else - (echo '{"id":1, "method":"Devices.GetSupportedVendors"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.GetSupportedVendors"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/getversion.sh b/tests/scripts/getversion.sh index 93f11499..fa7d7be3 100755 --- a/tests/scripts/getversion.sh +++ b/tests/scripts/getversion.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage: $0 host" else - (echo '{"id":1, "method": "JSONRPC.Version"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method": "JSONRPC.Version"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/introspect.sh b/tests/scripts/introspect.sh index 623d30db..79017391 100755 --- a/tests/scripts/introspect.sh +++ b/tests/scripts/introspect.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage: $0 host" else - (echo '{"id":1, "method": "JSONRPC.Introspect"}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method": "JSONRPC.Introspect"}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/pairdevice.sh b/tests/scripts/pairdevice.sh index 2cef04a8..fe49729d 100755 --- a/tests/scripts/pairdevice.sh +++ b/tests/scripts/pairdevice.sh @@ -3,9 +3,9 @@ if [ -z $3 ]; then echo "usage: $0 host justadd|discovery deviceClassId [deviceDescriptorId]" elif [ $2 == "justadd" ]; then - (echo '{"id":1, "method":"Devices.PairDevice", "params":{"deviceClassId":"'$3'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.PairDevice", "params":{"deviceClassId":"'$3'"}}'; sleep 1) | nc $1 2222 elif [ $2 == "discovery" ]; then - (echo '{"id":1, "method":"Devices.PairDevice", "params":{"deviceClassId":"'$3'", "deviceDescriptorId":"'$4'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.PairDevice", "params":{"deviceClassId":"'$3'", "deviceDescriptorId":"'$4'"}}'; sleep 1) | nc $1 2222 else echo "usage: $0 host justadd|discovery deviceClassId [deviceDescriptorId]" fi diff --git a/tests/scripts/removeconfigureddevice.sh b/tests/scripts/removeconfigureddevice.sh index 05caae18..6ef93a96 100755 --- a/tests/scripts/removeconfigureddevice.sh +++ b/tests/scripts/removeconfigureddevice.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host deviceId" else - (echo '{"id":1, "method":"Devices.RemoveConfiguredDevice", "params":{"deviceId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.RemoveConfiguredDevice", "params":{"deviceId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/removerule.sh b/tests/scripts/removerule.sh index 7882dfb7..fdd7e0cf 100755 --- a/tests/scripts/removerule.sh +++ b/tests/scripts/removerule.sh @@ -3,5 +3,5 @@ if [ -z $2 ]; then echo "usage: $0 host ruleId" else - (echo '{"id":1, "method":"Rules.RemoveRule", "params":{"ruleId":"'$2'"}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Rules.RemoveRule", "params":{"ruleId":"'$2'"}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/sendmail.sh b/tests/scripts/sendmail.sh index 7ba7406d..ea0b3be9 100755 --- a/tests/scripts/sendmail.sh +++ b/tests/scripts/sendmail.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage: $0 host deviceId subject body" else - (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{054613b0-3666-4dad-9252-e0ebca187edc}", "deviceId":"{'$2'}","params":[{"subject":"'$3'"}, {"body":"'$4'"}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Actions.ExecuteAction","params":{"actionTypeId": "{054613b0-3666-4dad-9252-e0ebca187edc}", "deviceId":"{'$2'}","params":[{"subject":"'$3'"}, {"body":"'$4'"}]}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/setpluginconfig.sh b/tests/scripts/setpluginconfig.sh index 7b6f660c..cffd0db1 100755 --- a/tests/scripts/setpluginconfig.sh +++ b/tests/scripts/setpluginconfig.sh @@ -3,9 +3,9 @@ if [ -z $4 ]; then echo "usage $0 host pluginid param1name param1value [param2name param2value]" elif [ -z $5 ]; then - (echo '{"id":1, "method":"Devices.SetPluginConfiguration", "params":{"pluginId":"'$2'", "configuration":[{"'$3'":"'$4'"}]}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.SetPluginConfiguration", "params":{"pluginId":"'$2'", "configuration":[{"'$3'":"'$4'"}]}}'; sleep 1) | nc $1 2222 elif [ -z $6 ]; then echo "usage $0 host pluginid param1name param1value [param2name param2value]" else - (echo '{"id":1, "method":"Devices.SetPluginConfiguration", "params":{"pluginId":"'$2'", "configuration":{[{"'$3'":"'$4'"}, {"'$5'":"'$6'"}]}}}'; sleep 1) | nc $1 1234 + (echo '{"id":1, "method":"Devices.SetPluginConfiguration", "params":{"pluginId":"'$2'", "configuration":{[{"'$3'":"'$4'"}, {"'$5'":"'$6'"}]}}}'; sleep 1) | nc $1 2222 fi diff --git a/tests/scripts/snoopnotifications.sh b/tests/scripts/snoopnotifications.sh index f764db8e..3e99765c 100755 --- a/tests/scripts/snoopnotifications.sh +++ b/tests/scripts/snoopnotifications.sh @@ -3,5 +3,5 @@ if [ -z $1 ]; then echo "usage $0 host" else - (echo '{"id":1, "method":"JSONRPC.SetNotificationStatus", "params":{"enabled":"true"}}'; read) | nc $1 1234 + (echo '{"id":1, "method":"JSONRPC.SetNotificationStatus", "params":{"enabled":"true"}}'; read) | nc $1 2222 fi