From 8744903325fd3c63dfef57179571db5545d351f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 20 Dec 2024 10:06:03 +0100 Subject: [PATCH] Update JSON RPC API to 8.2 --- tests/auto/api.json | 50 +++++++++++++++++++++++++++++- tests/auto/jsonrpc/testjsonrpc.cpp | 4 ++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/tests/auto/api.json b/tests/auto/api.json index a9dd7667..aa969843 100644 --- a/tests/auto/api.json +++ b/tests/auto/api.json @@ -1,4 +1,4 @@ -8.1 +8.2 { "enums": { "BasicType": [ @@ -41,6 +41,9 @@ "CreateMethodAuto", "CreateMethodDiscovery" ], + "DebugError": [ + "DebugErrorNoError" + ], "DiscoveryType": [ "DiscoveryTypePrecise", "DiscoveryTypeWeak" @@ -64,6 +67,17 @@ "InputTypeUrl", "InputTypeMacAddress" ], + "LoggingCategoryType": [ + "LoggingCategoryTypeSystem", + "LoggingCategoryTypePlugin", + "LoggingCategoryTypeCustom" + ], + "LoggingLevel": [ + "LoggingLevelCritical", + "LoggingLevelWarning", + "LoggingLevelInfo", + "LoggingLevelDebug" + ], "MediaBrowserIcon": [ "MediaBrowserIconNone", "MediaBrowserIconPlaylist", @@ -819,6 +833,28 @@ "configurationError": "$ref:ConfigurationError" } }, + "Debug.GetLoggingCategories": { + "description": "Get all available logging categories.", + "params": { + }, + "permissionScope": "PermissionScopeAdmin", + "returns": { + "loggingCategories": [ + "$ref:LoggingCategory" + ] + } + }, + "Debug.SetLoggingCategoryLevel": { + "description": "Set the logging category with the given name to the given logging level.", + "params": { + "level": "$ref:LoggingLevel", + "name": "String" + }, + "permissionScope": "PermissionScopeAdmin", + "returns": { + "debugError": "$ref:DebugError" + } + }, "Integrations.AddThing": { "description": "Add a new thing to the system. Only things with a setupMethod of SetupMethodJustAdd can be added this way. For things with a setupMethod different than SetupMethodJustAdd, use PairThing. Things with CreateMethodJustAdd require all parameters to be supplied here. Things with CreateMethodDiscovery require the use of a thingDescriptorId. For discovered things, params are not required and will be taken from the ThingDescriptor, however, they may be overridden by supplying thingParams.", "params": { @@ -2375,6 +2411,13 @@ "id": "String" } }, + "Debug.LoggingCategoryLevelChanged": { + "description": "Emitted whenever a logging category has changed the logging level.", + "params": { + "level": "$ref:LoggingLevel", + "name": "String" + } + }, "Integrations.EventTriggered": { "description": "Emitted whenever an Event is triggered.", "params": { @@ -2881,6 +2924,11 @@ "r:timestamp": "Uint", "r:values": "Object" }, + "LoggingCategory": { + "level": "$ref:LoggingLevel", + "name": "String", + "type": "$ref:LoggingCategoryType" + }, "ModbusRtuMaster": { "baudrate": "Uint", "connected": "Bool", diff --git a/tests/auto/jsonrpc/testjsonrpc.cpp b/tests/auto/jsonrpc/testjsonrpc.cpp index 63ddc2bf..3a5bad65 100644 --- a/tests/auto/jsonrpc/testjsonrpc.cpp +++ b/tests/auto/jsonrpc/testjsonrpc.cpp @@ -699,7 +699,9 @@ void TestJSONRPC::enableDisableNotifications_legacy() QStringList expectedNamespaces; if (enabled == "true") { - expectedNamespaces << "NetworkManager" << "Integrations" << "System" << "Rules" << "Logging" << "Tags" << "AppData" << "JSONRPC" << "Configuration" << "Scripts" << "Users" << "Zigbee" << "ZWave" << "ModbusRtu"; + expectedNamespaces << "NetworkManager" << "Integrations" << "System" << "Rules" << "Logging" << "Tags" + << "AppData" << "JSONRPC" << "Configuration" << "Scripts" << "Users" << "Zigbee" + << "ZWave" << "ModbusRtu" << "Debug"; } std::sort(expectedNamespaces.begin(), expectedNamespaces.end());