From 8dc853103336434867a8f65565143816d265fddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Mon, 22 Feb 2016 16:08:10 +0100 Subject: [PATCH] add pluginId to DeviceClass -> close #294 --- guh.pri | 2 +- server/jsonrpc/jsontypes.cpp | 2 ++ tests/auto/api.json | 11 +++++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/guh.pri b/guh.pri index eb15dca7..43d00b63 100644 --- a/guh.pri +++ b/guh.pri @@ -2,7 +2,7 @@ GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"') # define protocol versions -JSON_PROTOCOL_VERSION=35 +JSON_PROTOCOL_VERSION=36 REST_API_VERSION=1 DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \ diff --git a/server/jsonrpc/jsontypes.cpp b/server/jsonrpc/jsontypes.cpp index 77287d7b..ff7d89bd 100644 --- a/server/jsonrpc/jsontypes.cpp +++ b/server/jsonrpc/jsontypes.cpp @@ -189,6 +189,7 @@ void JsonTypes::init() // DeviceClass s_deviceClass.insert("id", basicTypeToString(Uuid)); s_deviceClass.insert("vendorId", basicTypeToString(Uuid)); + s_deviceClass.insert("pluginId", basicTypeToString(Uuid)); s_deviceClass.insert("name", basicTypeToString(String)); s_deviceClass.insert("basicTags", QVariantList() << basicTagRef()); s_deviceClass.insert("stateTypes", QVariantList() << stateTypeRef()); @@ -524,6 +525,7 @@ QVariantMap JsonTypes::packDeviceClass(const DeviceClass &deviceClass) variant.insert("name", deviceClass.name()); variant.insert("id", deviceClass.id()); variant.insert("vendorId", deviceClass.vendorId()); + variant.insert("pluginId", deviceClass.pluginId()); QVariantList basicTags; foreach (const DeviceClass::BasicTag &basicTag, deviceClass.basicTags()) { diff --git a/tests/auto/api.json b/tests/auto/api.json index fde4d1bf..8158a38c 100644 --- a/tests/auto/api.json +++ b/tests/auto/api.json @@ -1,4 +1,4 @@ -35 +36 { "methods": { "Actions.ExecuteAction": { @@ -577,7 +577,13 @@ "params": [ "$ref:Param" ], - "setupComplete": "Bool" + "setupComplete": "Bool", + "states": [ + { + "stateTypeId": "Uuid", + "value": "Variant" + } + ] }, "DeviceClass": { "actionTypes": [ @@ -600,6 +606,7 @@ "paramTypes": [ "$ref:ParamType" ], + "pluginId": "Uuid", "setupMethod": "$ref:SetupMethod", "stateTypes": [ "$ref:StateType"