diff --git a/.gitignore b/.gitignore index b3c9d945..e2111b12 100644 --- a/.gitignore +++ b/.gitignore @@ -23,8 +23,6 @@ qrc_*.cpp *.dirs *.install *.substvars -plugininfo.h -extern-plugininfo.h tests/auto/actions/testactions tests/auto/configurations/testconfigurations tests/auto/devices/testdevices diff --git a/debian/control b/debian/control index e4a1e073..f01c76de 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,6 @@ Homepage: https://nymea.io Vcs-Git: https://github.com/guh/guh.git Build-Depends: debhelper (>= 9.0.0), dpkg-dev (>= 1.16.1~), - python:any, rsync, qtchooser, qt5-default, @@ -154,7 +153,6 @@ Architecture: any Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends}, - libqt5bluetooth5, Replaces: libguh1 Description: An open source IoT server - core library The nymea daemon is a plugin based IoT (Internet of Things) server. The @@ -173,12 +171,7 @@ Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends}, libnymea1 (= ${binary:Version}), - libqt5websockets5-dev, pkg-config, - python:any, - qtconnectivity5-dev, - qttools5-dev-tools, - rsync, Replaces: libguh1-dev Description: An open source IoT server - development files The nymea daemon is a plugin based IoT (Internet of Things) server. The diff --git a/debian/libnymea1-dev.install.in b/debian/libnymea1-dev.install.in index 77a19f61..94b14cde 100644 --- a/debian/libnymea1-dev.install.in +++ b/debian/libnymea1-dev.install.in @@ -1,5 +1,5 @@ usr/lib/@DEB_HOST_MULTIARCH@/libnymea.so usr/include/nymea/* usr/include/nymea -usr/bin/nymea-generateplugininfo usr/bin +usr/bin/nymea-plugininfocompiler usr/lib/@DEB_HOST_MULTIARCH@/nymea/bin libnymea/devices/plugin.pri usr/include/nymea/ usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/nymea.pc diff --git a/debian/libnymea1-dev.manpages b/debian/libnymea1-dev.manpages index bbc12d59..66ca3fc0 100644 --- a/debian/libnymea1-dev.manpages +++ b/debian/libnymea1-dev.manpages @@ -1 +1 @@ -debian/man/nymea-generateplugininfo.1 +debian/man/nymea-plugininfocompiler.1 diff --git a/debian/libnymea1-dev.postinst b/debian/libnymea1-dev.postinst new file mode 100644 index 00000000..fb460e4c --- /dev/null +++ b/debian/libnymea1-dev.postinst @@ -0,0 +1,9 @@ +#!/bin/bash + +HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH_CPU` +HOST_MULTI_ARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH` + +if [ "$DPKG_MAINTSCRIPT_ARCH" = "$HOST_ARCH" ]; then + echo Symlinking /usr/lib/$HOST_MULTI_ARCH/nymea/bin/nymea-plugininfocompiler to /usr/bin/nymea-plugininfocompiler + ln -s /usr/lib/$HOST_MULTI_ARCH/nymea/bin/nymea-plugininfocompiler /usr/bin/nymea-plugininfocompiler +fi diff --git a/debian/libnymea1-dev.postrm b/debian/libnymea1-dev.postrm new file mode 100644 index 00000000..484e119f --- /dev/null +++ b/debian/libnymea1-dev.postrm @@ -0,0 +1,10 @@ +#!/bin/bash + +HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH_CPU` + +if [ "$DPKG_MAINTSCRIPT_ARCH" = "$HOST_ARCH" ]; then + if [ -e /usr/bin/nymea-plugininfocompiler ]; then + echo Removing symlink /usr/bin/nymea-plugininfocompiler + rm /usr/bin/nymea-plugininfocompiler + fi +fi diff --git a/debian/man/nymea-generateplugininfo.1 b/debian/man/nymea-plugininfocompiler.1 similarity index 56% rename from debian/man/nymea-generateplugininfo.1 rename to debian/man/nymea-plugininfocompiler.1 index 271ff388..24a4a11c 100644 --- a/debian/man/nymea-generateplugininfo.1 +++ b/debian/man/nymea-plugininfocompiler.1 @@ -1,38 +1,29 @@ -.\" Manpage for nymea-generateplugininfo. +.\" Manpage for nymea-plugininfo. .\" Contact simon.stuerz@guh.io to correct errors or typos. -.TH man 1 "March 2017" "1.0.1" "nymea-generateplugininfo man page" +.TH man 1 "Jun 2019" "1.0.0" "nymea-plugininfocompiler man page" .SH NAME -nymea-generateplugininfo \- A precompiler for building nymea plugins. +nymea-plugininfocompiler \- A precompiler for building nymea plugins. .SH SYNOPSIS -.B nymea-generateplugininfo +.B nymea-plugininfocompiler [\fIOPTION\fR] .SH DESCRIPTION -The nymea-generateplugininfo is a precompiler for building plugins. This +The nymea-plugininfocompiler is a precompiler for building plugins. This precompiler will create a plugininfo.h containing the uuid definitions from the plugin json file and creates the translations for the plugin. +.SH USAGE +nymea-plugininfocompiler [options] inputfile .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Displays this help. .TP -\fB\-v\fR, \fB\-\-version\fR -Displays version information. -.TP -\fB\-f\fR, \fB\-\-filetype\fR, \fB{e, i}\fR -The file type to generate: e = extern infofile, i = infofile. -.TP -\fB\-j\fR, \fB\-\-jsonfile\fR, \fB\\fR The JSON input file name with the plugin description. .TP -\fB\-b\fR, \fB\-\-builddir\fR, \fB\\fR -The path to the build directory of the plugin where the plugininfo.h -file can be found.. -.TP \fB\-o\fR, \fB\-\-output\fR, \fB\\fR -The plugininfo.h outputFile with the uuid declarations. +The plugininfo.h outputFile with the uuid definitions. .TP -\fB\-t\fR, \fB\-\-translations\fR, \fB[<*.ts>]\fR -The translation files for the plugin. +\fB\-e\fR, \fB\-\-extern\fR, \fB[]\fR +The extern-plugininfo.h output file with the uuid forward declarations. .SH SEE ALSO Full developer documentation at: diff --git a/doc/plugin-json.qdoc b/doc/plugin-json.qdoc index 0e12a774..43adf97f 100644 --- a/doc/plugin-json.qdoc +++ b/doc/plugin-json.qdoc @@ -5,9 +5,9 @@ Each \l{DevicePlugin}{Plugin} in nymea will be defined in the corresponding JSON file. You can find information how to read JSON \l{http://json.org/}{here}. This file will be loaded from the \l{DeviceManager} to define the plugin and the corresponding DeviceClasses internal. - \section1 The nymea-generateplugininfo precompiler + \section1 The nymea-plugininfocompiler precompiler - The \tt {\b nymea-generateplugininfo} precompiler will parse this file and generates a \tt plugininfo.h and a \tt extern-plugininfo.h file containing the definitions of: + The \tt {\b nymea-plugininfocompiler} precompiler will parse this file and generates a \tt plugininfo.h and a \tt extern-plugininfo.h file containing the definitions of: \list \li \l{PluginId}: <\e pluginId \unicode{0x2192} the defined UUID for the \l{DevicePlugin}. \li \l{VendorId}: <\e name>VendorId \unicode{0x2192} the defined UUID for the corresponding \l{Vendor}. diff --git a/doc/tutorials/plugin-wizard.qdoc b/doc/tutorials/plugin-wizard.qdoc index 00970f52..3860dbf7 100644 --- a/doc/tutorials/plugin-wizard.qdoc +++ b/doc/tutorials/plugin-wizard.qdoc @@ -176,7 +176,7 @@ The implementation of each method can be found in the corresponding \tt{cpp} file. As you can see, the plugin includes in the cpp file the \tt{plugininfo.h} file, which will be generated during build time - from the \tt{nymea-generateplugininfo} tool. This tool translates the \l{deviceplugintemplate.json} into a c++ header file + from the \tt{nymea-plugininfocompiler} tool. This tool translates the \l{deviceplugintemplate.json} into a c++ header file containing all uuid definitions, translations strings and the debug catergory definition. \quotefromfile template/deviceplugintemplate.cpp diff --git a/doc/tutorials/your-first-plugin.qdoc b/doc/tutorials/your-first-plugin.qdoc index ed30d2a6..6a604b26 100644 --- a/doc/tutorials/your-first-plugin.qdoc +++ b/doc/tutorials/your-first-plugin.qdoc @@ -111,9 +111,9 @@ Once you updated the JSON file, you have to rebuild the whole plugin in order to trigger a rebuild of the plugin information include files. - \section2 nymea-generateplugininfo + \section2 nymea-plugininfocompiler - Before the source code will be compiled, a precompiler called \tt {nymea-generateplugininfo} will be launched. This tool will + Before the source code will be compiled, a precompiler called \tt {nymea-plugininfocompiler} will be launched. This tool will read the plugin JSON file and generate two header files for the plugin in the build directory. \section3 plugininfo.h @@ -150,7 +150,7 @@ \section1 Test the plugin Now it's time to build you first plugin. In order to make sure all changes in you JSON file are up to date press the \tt{Rebuild all} instead - of only \tt {Build}. This will rerun the nymea-generateplugininfo tool and update the \tt plugininfo.h and \tt extern-plugininfo.h files. + of only \tt {Build}. This will rerun the nymea-plugininfocompiler tool and update the \tt plugininfo.h and \tt extern-plugininfo.h files. \note Coming soon! diff --git a/libnymea-core/devices/devicemanagerimplementation.cpp b/libnymea-core/devices/devicemanagerimplementation.cpp index 3c5c5242..c776a2c4 100644 --- a/libnymea-core/devices/devicemanagerimplementation.cpp +++ b/libnymea-core/devices/devicemanagerimplementation.cpp @@ -849,7 +849,7 @@ void DeviceManagerImplementation::loadPlugins() // Check plugin API version compatibility QLibrary lib(fi.absoluteFilePath()); - QString *version = reinterpret_cast(lib.resolve("nymea_plugin_api_version")); + QString *version = reinterpret_cast(lib.resolve("libnymea_api_version")); if (!version) { qCWarning(dcDeviceManager()).nospace() << "Unable to resolve version in plugin " << entry << ". Not loading plugin."; loader.unload(); @@ -858,9 +858,9 @@ void DeviceManagerImplementation::loadPlugins() } lib.unload(); QStringList parts = version->split('.'); - QStringList coreParts = QString(DEVICE_PLUGIN_API_VERSION).split('.'); - if (parts.length() != 2 || parts.at(0).toInt() != coreParts.at(0).toInt() || parts.at(1).toInt() > coreParts.at(1).toInt()) { - qCWarning(dcDeviceManager()).nospace() << "Plugin API mismatch for " << entry << ". Core API: " << DEVICE_PLUGIN_API_VERSION << ", Plugin API: " << *version; + QStringList coreParts = QString(LIBNYMEA_API_VERSION).split('.'); + if (parts.length() != 3 || parts.at(0).toInt() != coreParts.at(0).toInt() || parts.at(1).toInt() > coreParts.at(1).toInt()) { + qCWarning(dcDeviceManager()).nospace() << "Libnymea API mismatch for " << entry << ". Core API: " << LIBNYMEA_API_VERSION << ", Plugin API: " << *version; loader.unload(); continue; } diff --git a/libnymea/devices/nymea-generateplugininfo b/libnymea/devices/nymea-generateplugininfo deleted file mode 100755 index 208cee55..00000000 --- a/libnymea/devices/nymea-generateplugininfo +++ /dev/null @@ -1,473 +0,0 @@ -#!/usr/bin/env python - -# -*- coding: UTF-8 -*- - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# # -# Copyright (C) 2015-2018 Simon Stuerz # -# Copyright (C) 2014-2019 Michael Zanetti # -# # -# This file is part of nymea. # -# # -# nymea is free software: you can redistribute it and/or modify # -# it under the terms of the GNU General Public License as published by # -# the Free Software Foundation, version 2 of the License. # -# # -# nymea is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU General Public License for more details. # -# # -# You should have received a copy of the GNU General Public License # -# along with nymea. If not, see . # -# # -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -import argparse -import traceback -import json -import os -import subprocess - -__version__='1.0.2' - -################################################################################################################## -# Methods - -#----------------------------------------------------------------------------------------------------------------- -def printInfo(info): - if args.filetype is 'i': - print(info) - - -#----------------------------------------------------------------------------------------------------------------- -def printWarning(warning): - print('Warning: ' + warning) - - -#----------------------------------------------------------------------------------------------------------------- -def printError(error): - print('Error: ' + error) - - -#----------------------------------------------------------------------------------------------------------------- -def writeToFile(line): - outputFile.write('%s\n' % line) - - -#----------------------------------------------------------------------------------------------------------------- -def extractPlugin(pluginMap): - variableName = 'pluginId' - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define PluginId pluginId = %s' % (pluginMap['id'])) - if args.filetype is 'i': - writeToFile('PluginId pluginId = PluginId(\"%s\");' % (pluginMap['id'])) - addTranslationString(pluginMap['displayName'], 'The name of the plugin %s (%s)' % (pluginMap['name'], pluginMap['id'])) - createExternDefinition('PluginId', variableName) - - # Extract plugin params (configurations) - if 'paramTypes' in pluginMap: - extractParamTypes(pluginMap['paramTypes'], pluginMap['name'][0].lower() + pluginMap['name'][1:], "", 'plugin') - - if 'vendors' in pluginMap: - extractVendors(pluginMap['vendors']) - - -#----------------------------------------------------------------------------------------------------------------- -def extractParamTypes(paramTypes, deviceClassName, typeClass, typeName): - for paramType in paramTypes: - try: - variableName = '%sParamTypeId' % (deviceClassName + typeName[0].capitalize() + typeName[1:] + typeClass + paramType['name'][0].capitalize() + paramType['name'][1:]) - print("....variable:", variableName) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define ParamTypeId %s = %s' % (variableName, paramType['id'])) - if args.filetype is 'i': - writeToFile('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, paramType['id'])) - addTranslationString(paramType['displayName'], 'The name of the ParamType (DeviceClass: %s, %sType: %s, ID: %s)' % (deviceClassName, typeClass, typeName, paramType['id'])) - createExternDefinition('ParamTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for ParamTypeId %s -> skipping' % (variableName, paramType['id'])) - except: - pass - - -#----------------------------------------------------------------------------------------------------------------- -def extractVendors(vendors): - for vendor in vendors: - try: - variableName = '%sVendorId' % (vendor['name']) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define VendorId %s = %s' % (variableName, vendor['id'])) - if args.filetype is 'i': - writeToFile('VendorId %s = VendorId(\"%s\");' % (variableName, vendor['id'])) - addTranslationString(vendor['displayName'], 'The name of the vendor (%s)' % vendor['id']) - createExternDefinition('VendorId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for VendorId %s -> skipping' % (variableName, param['id'])) - except: - pass - - if 'deviceClasses' in vendor: - extractDeviceClasses(vendor['deviceClasses']) - - -#----------------------------------------------------------------------------------------------------------------- -def extractDeviceClasses(deviceClasses): - for deviceClass in deviceClasses: - try: - variableName = '%sDeviceClassId' % (deviceClass['name']) - - if 'pairingInfo' in deviceClass: - addTranslationString(deviceClass['pairingInfo'], 'The pairing info of deviceClass %s' % deviceClass['name']) - - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define DeviceClassId %s = %s' % (variableName, deviceClass['id'])) - if args.filetype is 'i': - writeToFile('DeviceClassId %s = DeviceClassId(\"%s\");' % (variableName, deviceClass['id'])) - addTranslationString(deviceClass['displayName'], 'The name of the DeviceClass (%s)' %(deviceClass['id'])) - createExternDefinition('DeviceClassId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for DeviceClassId %s -> skipping' % (variableName, deviceClass['deviceClassId'])) - - except: - pass - - if 'paramTypes' in deviceClass: - extractParamTypes(deviceClass['paramTypes'], deviceClass['name'], "", 'device') - - if 'settingsTypes' in deviceClass: - extractParamTypes(deviceClass['settingsTypes'], deviceClass['name'], "", 'settings') - - if 'discoveryParamTypes' in deviceClass: - extractParamTypes(deviceClass['discoveryParamTypes'], deviceClass['name'], "", 'discovery') - - if 'stateTypes' in deviceClass: - extractStateTypes(deviceClass['stateTypes'], deviceClass['name'],) - - if 'actionTypes' in deviceClass: - extractActionTypes(deviceClass['actionTypes'], deviceClass['name']) - - if 'eventTypes' in deviceClass: - extractEventTypes(deviceClass['eventTypes'], deviceClass['name']) - - -#----------------------------------------------------------------------------------------------------------------- -def extractStateTypes(stateTypes, deviceClassName): - for stateType in stateTypes: - try: - # Define StateType - variableName = '%s%sStateTypeId' % (deviceClassName, stateType['name'][0].capitalize() + stateType['name'][1:]) - #addTranslationString(stateType['name'], 'The name of the stateType (%s) of DeviceClass %s' % (stateType['id'], deviceClassName)) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define StateTypeId %s = %s' % (variableName, stateType['id'])) - if args.filetype is 'i': - writeToFile('StateTypeId %s = StateTypeId(\"%s\");' % (variableName, stateType['id'])) - createExternDefinition('StateTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for StateTypeId %s -> skipping' % (variableName, stateType['id'])) - - # Create EventTypeId for this state - variableName = '%s%sEventTypeId' % (deviceClassName, stateType['name'][0].capitalize() + stateType['name'][1:]) - if not variableName in variableNames: - addTranslationString(stateType['displayNameEvent'], 'The name of the autocreated EventType (DeviceClass: %s, StateType: %s, ID: %s)' % (deviceClassName, stateType['name'], stateType['id'])) - variableNames.append(variableName) - printInfo('Define EventTypeId %s = %s' % (variableName, stateType['id'])) - if args.filetype is 'i': - writeToFile('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, stateType['id'])) - createExternDefinition('EventTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for autocreated EventTypeId %s -> skipping' % (variableName, stateType['id'])) - - # ParamType for the autocreated EventType - variableName = '%s%sEvent%sParamTypeId' % (deviceClassName, stateType['name'][0].capitalize() + stateType['name'][1:], stateType['name'][0].capitalize() + stateType['name'][1:]) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define ParamTypeId %s for StateType %s = %s' % (variableName, variableName, stateType['id'])) - addTranslationString(stateType['displayName'], 'The name of the ParamType for the autocreated EventType (DeviceClass: %s, StateType: %s, ID: %s' % (deviceClassName, stateType['name'], stateType['id'])) - if args.filetype is 'i': - writeToFile('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, stateType['id'])) - createExternDefinition('ParamTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for ParamTypeId %s -> skipping' % (variableName, stateType['id'])) - - # Create ActionTypeId and ParamTypeId for action if the state is writable - if 'writable' in stateType and stateType['writable']: - # Create ActionType for the writable state - variableName = '%s%sActionTypeId' % (deviceClassName, stateType['name'][0].capitalize() + stateType['name'][1:]) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define ActionTypeId for writable StateType %s = %s' % (variableName, stateType['id'])) - addTranslationString(stateType['displayNameAction'], 'The name of the autocreated ActionType (DeviceClass: %s, StateType: %s, ID: %s)' % (deviceClassName, stateType['name'], stateType['id'])) - if args.filetype is 'i': - writeToFile('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, stateType['id'])) - createExternDefinition('ActionTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for autocreated ActionTypeId %s -> skipping' % (variableName, stateType['id'])) - - # ParamType for the autocreated ActionType - variableName = '%s%sAction%sParamTypeId' % (deviceClassName, stateType['name'][0].capitalize() + stateType['name'][1:], stateType['name'][0].capitalize() + stateType['name'][1:]) - if not variableName in variableNames: - variableNames.append(variableName) - printInfo('Define ParamTypeId %s for autocreated ActionType %s = %s' % (variableName, variableName, stateType['id'])) - addTranslationString(stateType['displayName'], 'The name of the ParamType for the autocreated ActionType (DeviceClass: %s, StateType: %s, ID: %s)' % (deviceClassName, stateType['name'], stateType['id'])) - if args.filetype is 'i': - writeToFile('ParamTypeId %s = ParamTypeId(\"%s\");' % (variableName, stateType['id'])) - createExternDefinition('ParamTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for ParamTypeId %s -> skipping' % (variableName, stateType['id'])) - - except: - pass - - -#----------------------------------------------------------------------------------------------------------------- -def extractActionTypes(actionTypes, deviceClassName): - for actionType in actionTypes: - try: - # Define ActionTypeId - variableName = '%s%sActionTypeId' % (deviceClassName, actionType['name'][0].capitalize() + actionType['name'][1:]) - if not variableName in variableNames: - variableNames.append(variableName) - addTranslationString(actionType['displayName'], 'The name of the ActionType %s of deviceClass %s' % (actionType['id'], deviceClassName)) - if args.filetype is 'i': - writeToFile('ActionTypeId %s = ActionTypeId(\"%s\");' % (variableName, actionType['id'])) - createExternDefinition('ActionTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for ActionTypeId %s -> skipping' % (variableName, actionType['id'])) - - except: - pass - - # Define paramTypes of this ActionType - if 'paramTypes' in actionType: - extractParamTypes(actionType['paramTypes'], deviceClassName, 'Action', actionType['name']) - - -#----------------------------------------------------------------------------------------------------------------- -def extractEventTypes(eventTypes, deviceClassName): - for eventType in eventTypes: - try: - # Define EventTypeId - variableName = '%s%sEventTypeId' % (deviceClassName, eventType['name'][0].capitalize() + eventType['name'][1:]) - if not variableName in variableNames: - variableNames.append(variableName) - addTranslationString(eventType['displayName'], 'The name of the EventType %s of deviceClass %s' % (eventType['id'], deviceClassName)) - if args.filetype is 'i': - writeToFile('EventTypeId %s = EventTypeId(\"%s\");' % (variableName, eventType['id'])) - createExternDefinition('EventTypeId', variableName) - else: - printWarning('Duplicated variable name \"%s\" for EventTypeId %s -> skipping' % (variableName, eventType['id'])) - except: - pass - - # Define paramTypes of this EventType - if 'paramTypes' in eventType: - extractParamTypes(eventType['paramTypes'], deviceClassName, 'Event', eventType['name']) - - -#----------------------------------------------------------------------------------------------------------------- -def createExternDefinition(type, name): - definition = {} - definition['type'] = type - definition['variable'] = name - externDefinitions.append(definition) - - -#----------------------------------------------------------------------------------------------------------------- -def addTranslationString(string, comment): - translationStrings.append([string, comment]) - - -#----------------------------------------------------------------------------------------------------------------- -def writeTranslationStrings(): - if len(translationStrings) is not 0: - writeToFile('// Translation strings') - writeToFile('const QString translations[] {') - - for index, value in enumerate(translationStrings): - writeToFile(' //: %s' % value[1]) - if index != len(translationStrings) - 1: - writeToFile(' QT_TRANSLATE_NOOP(\"%s\", \"%s\"), \n' % (pluginMap['name'], value[0])) - else: - writeToFile(' QT_TRANSLATE_NOOP(\"%s\", \"%s\")' % (pluginMap['name'], value[0])) - - writeToFile('};') - - -#----------------------------------------------------------------------------------------------------------------- -def createTranslationFiles(): - for translation in args.translations: - translationFile = (sourceDir + '/' + translation) - path, fileName = os.path.split(translationFile) - translationOutput = (path + '/' + pluginMap['id'] + '-' + os.path.splitext(fileName)[0] + '.qm') - printInfo(' --> Translation update %s' % translationFile) - printInfo(subprocess.check_output(['mkdir', '-p', path])) - printInfo(subprocess.check_output(['lupdate', '-recursive', '-no-obsolete', sourceDir, (args.builddir + '/' + args.output), '-ts', translationFile])) - printInfo(' --> Translation release %s' % translationOutput) - printInfo(subprocess.check_output(['lrelease', translationFile, '-qm', translationOutput])) - printInfo(' --> Copy translation files to build dir %s' % args.builddir + '/translations/') - subprocess.check_output(['rsync', '-a', translationOutput, args.builddir + '/translations/']) - - -#----------------------------------------------------------------------------------------------------------------- -def writePluginInfoFile(): - print(' --> Generate plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id'])) - - writeToFile('/* This file is generated by the nymea build system. Any changes to this file will') - writeToFile(' * be lost.') - writeToFile(' *') - writeToFile(' * If you want to change this file, edit the plugin\'s json file.') - writeToFile(' */') - writeToFile('') - writeToFile('#ifndef PLUGININFO_H') - writeToFile('#define PLUGININFO_H') - writeToFile('') - writeToFile('#include ') - writeToFile('#include ') - writeToFile('') - writeToFile('#include \"typeutils.h\"') - writeToFile('') - writeToFile('// Id definitions') - extractPlugin(pluginMap) - writeToFile('') - writeToFile('// Logging category') - - if 'name' in pluginMap: - debugCategoryName = pluginMap['name'][0].capitalize() + pluginMap['name'][1:] - writeToFile('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % debugCategoryName) - writeToFile('Q_LOGGING_CATEGORY(dc%s, \"%s\")' % (debugCategoryName, debugCategoryName)) - printInfo('Define logging category: \'dc%s\'' % debugCategoryName) - - writeToFile('') - - # Write translation strings - writeTranslationStrings() - - writeToFile('') - writeToFile('#endif // PLUGININFO_H') - outputFile.close() - print(' --> Generated successfully \"%s\"' % (args.output)) - - -#----------------------------------------------------------------------------------------------------------------- -def writeExternPluginInfoFile(): - print(' --> Generate extern-plugininfo.h for plugin \"%s\" = %s' % (pluginMap['name'], pluginMap['id'])) - extractPlugin(pluginMap) - writeToFile('/* This file is generated by the nymea build system. Any changes to this file will') - writeToFile(' * be lost.') - writeToFile(' *') - writeToFile(' * If you want to change this file, edit the plugin\'s json file.') - writeToFile(' */') - writeToFile('') - writeToFile('#ifndef EXTERNPLUGININFO_H') - writeToFile('#define EXTERNPLUGININFO_H') - writeToFile('#include \"typeutils.h\"') - writeToFile('#include ') - writeToFile('') - writeToFile('// Id definitions') - - for externDefinition in externDefinitions: - writeToFile('extern %s %s;' % (externDefinition['type'], externDefinition['variable'])) - - writeToFile('') - writeToFile('// Logging category definition') - - if 'name' in pluginMap: - debugCategoryName = pluginMap['name'][0].capitalize() + pluginMap['name'][1:] - writeToFile('Q_DECLARE_LOGGING_CATEGORY(dc%s)' % debugCategoryName) - - writeToFile('') - writeToFile('#endif // EXTERNPLUGININFO_H') - outputFile.close() - print(' --> Generated successfully \'%s\'' % (args.output)) - - -################################################################################################################## -# Main -################################################################################################################## - -if __name__ == '__main__': - # Argument parser - parser = argparse.ArgumentParser(description='The nymea-generateplugininfo is a precompiler for building plugins. This precompiler will create a plugininfo.h containing the uuid definitions from the plugin json file and creates the translations for the plugin.') - parser.add_argument('-j', '--jsonfile', help='The JSON input file name with the plugin description', metavar='jsonfile', required=True) - parser.add_argument('-b', '--builddir', help='The path to the build directory of the plugin where the plugininfo.h file can be found.', metavar='buildpath', required=True) - parser.add_argument('-f', '--filetype', help='The file type to generate: e = extern infofile, i = infofile', action='store', choices=['e', 'i'], default='i') - parser.add_argument('-o', '--output', help='The plugininfo.h outputFile with the uuid declarations', metavar='output') - parser.add_argument('-t', '--translations', help='The translation files for the plugin.', nargs='*', type=str, metavar='*.ts') - parser.add_argument('-v', '--version', action='version', version=__version__) - args = parser.parse_args() - - # Get the source directors - sourceDir = os.path.dirname(os.path.abspath(args.jsonfile)) - - # Print build information for debugging - printInfo('Json file: %s' % args.jsonfile) - printInfo('Output: %s/%s' % (args.builddir, args.output)) - printInfo('Build directory: %s' % args.builddir) - printInfo('Source directory: %s' % sourceDir) - printInfo('Translations: %s' % args.translations) - printInfo('FileType: %s' % args.filetype) - - # Tuple ('string to translate', 'comment for translater') - translationStrings = [] - - variableNames = [] - externDefinitions = [] - - # Open files - try: - inputFile = open(args.jsonfile, 'r') - except: - printError('Could not open file \"%s\"' % (args.jsonfile)) - exit -1 - - try: - outputFile = open(args.builddir + '/' + args.output, 'w') - except: - printError('Could not open file \"%s\"' % (args.jsonfile)) - exit -1 - - # Read json file - try: - pluginMap = json.loads(inputFile.read()) - inputFile.close() - except ValueError as error: - printError(' --> Could not load json input file \"%s\"' % (args.input)) - printError(' %s' % (error)) - inputFile.close() - exit -1 - - # If there is no translation yet, generate an empty one - translationsDir = "%s/translations/" % sourceDir - baseTranslationFile = "%s/%s-en_US.ts" % (translationsDir, pluginMap['id']) - if not os.path.isfile(baseTranslationFile): - try: - os.stat(translationsDir) - except: - os.mkdir(translationsDir) - try: - tsFile = open(baseTranslationFile, 'w') - tsFile.write("\n\n\n") - tsFile.close() - printInfo("Successfully generated base translation file: %s" % baseTranslationFile) - except: - printError("Could not generate %s" % baseTranslationsFile) - - - # Write files - if args.filetype is 'i': - writePluginInfoFile() - else: - writeExternPluginInfoFile() - - - - - - - diff --git a/libnymea/devices/plugin.pri b/libnymea/devices/plugin.pri index 67c087d6..1eccb4bb 100644 --- a/libnymea/devices/plugin.pri +++ b/libnymea/devices/plugin.pri @@ -47,19 +47,17 @@ OTHER_FILES+=deviceplugin"$$TARGET".json # Create plugininfo file plugininfo.target = $$OUT_PWD/plugininfo.h +extern-plugininfo.target = $$OUT_PWD/extern-plugininfo.h plugininfo_dummy.target = plugininfo.h +extern-plugininfo_dummy.target = extern-plugininfo.h plugininfo.depends = FORCE -plugininfo.commands = nymea-generateplugininfo --filetype i --jsonfile $${_PRO_FILE_PWD_}/deviceplugin"$$TARGET".json --output plugininfo.h --builddir $$OUT_PWD +plugininfo.commands = nymea-plugininfocompiler \ + $${_PRO_FILE_PWD_}/deviceplugin"$$TARGET".json \ + --output $$OUT_PWD/plugininfo.h \ + --extern $$OUT_PWD/extern-plugininfo.h plugininfo_dummy.commands = $$plugininfo.commands -QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy - -# Create extern-plugininfo file -extern_plugininfo.target = $$OUT_PWD/extern-plugininfo.h -extern_plugininfo_dummy.target = extern-plugininfo.h -extern_plugininfo.depends = FORCE -extern_plugininfo.commands = nymea-generateplugininfo --filetype e --jsonfile $${_PRO_FILE_PWD_}/deviceplugin"$$TARGET".json --output extern-plugininfo.h --builddir $$OUT_PWD -extern_plugininfo_dummy.commands = $$extern_plugininfo.commands -QMAKE_EXTRA_TARGETS += extern_plugininfo extern_plugininfo_dummy +extern-plugininfo.depends = plugininfo +QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy extern-plugininfo extern-plugininfo_dummy # Clean up autogenerated plugin info files plugininfo_clean.commands = rm -fv $$OUT_PWD/plugininfo.h $$OUT_PWD/extern-plugininfo.h diff --git a/libnymea/libnymea.pro b/libnymea/libnymea.pro index e090a616..d519076f 100644 --- a/libnymea/libnymea.pro +++ b/libnymea/libnymea.pro @@ -6,6 +6,7 @@ TEMPLATE = lib QT += network bluetooth DEFINES += LIBNYMEA_LIBRARY +QMAKE_CXXFLAGS += -Og QMAKE_LFLAGS += -fPIC HEADERS += \ @@ -142,11 +143,6 @@ RESOURCES += \ ## Install instructions -# install plugininfo python script for libnymea-dev -generateplugininfo.files = devices/nymea-generateplugininfo -generateplugininfo.path = $$[QT_INSTALL_PREFIX]/bin -INSTALLS += generateplugininfo - # install plugin.pri for external plugins pluginpri.files = devices/plugin.pri pluginpri.path = $$[QT_INSTALL_PREFIX]/include/nymea/ diff --git a/nymea.pri b/nymea.pri index 7e330678..1a665797 100644 --- a/nymea.pri +++ b/nymea.pri @@ -5,8 +5,9 @@ NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p" JSON_PROTOCOL_VERSION_MAJOR=2 JSON_PROTOCOL_VERSION_MINOR=2 REST_API_VERSION=1 -DEVICE_PLUGIN_API_VERSION_MAJOR=0 -DEVICE_PLUGIN_API_VERSION_MINOR=1 +LIBNYMEA_API_VERSION_MAJOR=2 +LIBNYMEA_API_VERSION_MINOR=1 +LIBNYMEA_API_VERSION_PATCH=0 COPYRIGHT_YEAR_FROM=2013 COPYRIGHT_YEAR_TO=2019 @@ -15,7 +16,7 @@ DEFINES += NYMEA_VERSION_STRING=\\\"$${NYMEA_VERSION_STRING}\\\" \ JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \ REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \ COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\" \ - DEVICE_PLUGIN_API_VERSION=\\\"$${DEVICE_PLUGIN_API_VERSION_MAJOR}.$${DEVICE_PLUGIN_API_VERSION_MINOR}\\\" + LIBNYMEA_API_VERSION=\\\"$${LIBNYMEA_API_VERSION_MAJOR}.$${LIBNYMEA_API_VERSION_MINOR}.$${LIBNYMEA_API_VERSION_PATCH}\\\" QT *= network websockets bluetooth dbus diff --git a/nymea.pro b/nymea.pro index ad164e88..efc7dcbe 100644 --- a/nymea.pro +++ b/nymea.pro @@ -2,11 +2,12 @@ include(nymea.pri) TEMPLATE=subdirs -SUBDIRS += libnymea libnymea-core server plugins +SUBDIRS += libnymea libnymea-core server plugins tools libnymea-core.depends = libnymea server.depends = libnymea libnymea-core plugins -plugins.depends = libnymea +tools.depends = libnymea +plugins.depends = libnymea tools tests.depends = libnymea libnymea-core doc.depends = FORCE diff --git a/plugins/mock/extern-plugininfo.h b/plugins/mock/extern-plugininfo.h new file mode 100644 index 00000000..426f708d --- /dev/null +++ b/plugins/mock/extern-plugininfo.h @@ -0,0 +1,245 @@ +/* This file is generated by the nymea build system. Any changes to this file will * + * be lost. If you want to change this file, edit the plugin's json file. */ + +#ifndef EXTERNPLUGININFO_H +#define EXTERNPLUGININFO_H + +#include "typeutils.h" + +#include + +Q_DECLARE_LOGGING_CATEGORY(dcMockDevice) + +extern PluginId pluginId; +extern ParamTypeId mockDevicePluginConfigParamIntParamTypeId; +extern ParamTypeId mockDevicePluginConfigParamBoolParamTypeId; +extern VendorId nymeaVendorId; +extern DeviceClassId mockDeviceClassId; +extern ParamTypeId mockDeviceHttpportParamTypeId; +extern ParamTypeId mockDeviceAsyncParamTypeId; +extern ParamTypeId mockDeviceBrokenParamTypeId; +extern ParamTypeId mockSettingsSetting1ParamTypeId; +extern ParamTypeId mockDiscoveryResultCountParamTypeId; +extern StateTypeId mockIntStateTypeId; +extern StateTypeId mockBoolStateTypeId; +extern StateTypeId mockDoubleStateTypeId; +extern StateTypeId mockBatteryLevelStateTypeId; +extern StateTypeId mockBatteryCriticalStateTypeId; +extern StateTypeId mockPowerStateTypeId; +extern EventTypeId mockIntEventTypeId; +extern ParamTypeId mockIntEventIntParamTypeId; +extern EventTypeId mockBoolEventTypeId; +extern ParamTypeId mockBoolEventBoolParamTypeId; +extern EventTypeId mockDoubleEventTypeId; +extern ParamTypeId mockDoubleEventDoubleParamTypeId; +extern EventTypeId mockBatteryLevelEventTypeId; +extern ParamTypeId mockBatteryLevelEventBatteryLevelParamTypeId; +extern EventTypeId mockBatteryCriticalEventTypeId; +extern ParamTypeId mockBatteryCriticalEventBatteryCriticalParamTypeId; +extern EventTypeId mockPowerEventTypeId; +extern ParamTypeId mockPowerEventPowerParamTypeId; +extern EventTypeId mockMockEvent1EventTypeId; +extern EventTypeId mockMockEvent2EventTypeId; +extern ParamTypeId mockMockEvent2EventMockParamIntParamTypeId; +extern ActionTypeId mockPowerActionTypeId; +extern ParamTypeId mockPowerActionPowerParamTypeId; +extern ActionTypeId mockWithParamsActionTypeId; +extern ParamTypeId mockWithParamsActionMockActionParam1ParamTypeId; +extern ParamTypeId mockWithParamsActionMockActionParam2ParamTypeId; +extern ActionTypeId mockWithoutParamsActionTypeId; +extern ActionTypeId mockMockAsyncActionTypeId; +extern ActionTypeId mockMockFailingActionTypeId; +extern ActionTypeId mockMockAsyncFailingActionTypeId; +extern DeviceClassId mockDeviceAutoDeviceClassId; +extern ParamTypeId mockDeviceAutoDeviceHttpportParamTypeId; +extern ParamTypeId mockDeviceAutoDeviceAsyncParamTypeId; +extern ParamTypeId mockDeviceAutoDeviceBrokenParamTypeId; +extern StateTypeId mockDeviceAutoIntStateTypeId; +extern StateTypeId mockDeviceAutoBoolValueStateTypeId; +extern EventTypeId mockDeviceAutoIntEventTypeId; +extern ParamTypeId mockDeviceAutoIntEventIntParamTypeId; +extern EventTypeId mockDeviceAutoBoolValueEventTypeId; +extern ParamTypeId mockDeviceAutoBoolValueEventBoolValueParamTypeId; +extern EventTypeId mockDeviceAutoEvent1EventTypeId; +extern EventTypeId mockDeviceAutoEvent2EventTypeId; +extern ParamTypeId mockDeviceAutoEvent2EventMockParamIntParamTypeId; +extern ActionTypeId mockDeviceAutoWithParamsActionTypeId; +extern ParamTypeId mockDeviceAutoWithParamsActionMockActionParam1ParamTypeId; +extern ParamTypeId mockDeviceAutoWithParamsActionMockActionParam2ParamTypeId; +extern ActionTypeId mockDeviceAutoMockActionNoParmsActionTypeId; +extern ActionTypeId mockDeviceAutoMockActionAsyncActionTypeId; +extern ActionTypeId mockDeviceAutoMockActionBrokenActionTypeId; +extern ActionTypeId mockDeviceAutoMockActionAsyncBrokenActionTypeId; +extern DeviceClassId mockPushButtonDeviceClassId; +extern ParamTypeId mockPushButtonDiscoveryResultCountParamTypeId; +extern StateTypeId mockPushButtonColorStateTypeId; +extern StateTypeId mockPushButtonPercentageStateTypeId; +extern StateTypeId mockPushButtonAllowedValuesStateTypeId; +extern StateTypeId mockPushButtonDoubleStateTypeId; +extern StateTypeId mockPushButtonBoolStateTypeId; +extern EventTypeId mockPushButtonColorEventTypeId; +extern ParamTypeId mockPushButtonColorEventColorParamTypeId; +extern EventTypeId mockPushButtonPercentageEventTypeId; +extern ParamTypeId mockPushButtonPercentageEventPercentageParamTypeId; +extern EventTypeId mockPushButtonAllowedValuesEventTypeId; +extern ParamTypeId mockPushButtonAllowedValuesEventAllowedValuesParamTypeId; +extern EventTypeId mockPushButtonDoubleEventTypeId; +extern ParamTypeId mockPushButtonDoubleEventDoubleParamTypeId; +extern EventTypeId mockPushButtonBoolEventTypeId; +extern ParamTypeId mockPushButtonBoolEventBoolParamTypeId; +extern ActionTypeId mockPushButtonColorActionTypeId; +extern ParamTypeId mockPushButtonColorActionColorParamTypeId; +extern ActionTypeId mockPushButtonPercentageActionTypeId; +extern ParamTypeId mockPushButtonPercentageActionPercentageParamTypeId; +extern ActionTypeId mockPushButtonAllowedValuesActionTypeId; +extern ParamTypeId mockPushButtonAllowedValuesActionAllowedValuesParamTypeId; +extern ActionTypeId mockPushButtonDoubleActionTypeId; +extern ParamTypeId mockPushButtonDoubleActionDoubleParamTypeId; +extern ActionTypeId mockPushButtonBoolActionTypeId; +extern ParamTypeId mockPushButtonBoolActionBoolParamTypeId; +extern ActionTypeId mockPushButtonTimeoutActionTypeId; +extern DeviceClassId mockDisplayPinDeviceClassId; +extern ParamTypeId mockDisplayPinDevicePinParamTypeId; +extern ParamTypeId mockDisplayPinDiscoveryResultCountParamTypeId; +extern StateTypeId mockDisplayPinColorStateTypeId; +extern StateTypeId mockDisplayPinPercentageStateTypeId; +extern StateTypeId mockDisplayPinAllowedValuesStateTypeId; +extern StateTypeId mockDisplayPinDoubleStateTypeId; +extern StateTypeId mockDisplayPinBoolStateTypeId; +extern EventTypeId mockDisplayPinColorEventTypeId; +extern ParamTypeId mockDisplayPinColorEventColorParamTypeId; +extern EventTypeId mockDisplayPinPercentageEventTypeId; +extern ParamTypeId mockDisplayPinPercentageEventPercentageParamTypeId; +extern EventTypeId mockDisplayPinAllowedValuesEventTypeId; +extern ParamTypeId mockDisplayPinAllowedValuesEventAllowedValuesParamTypeId; +extern EventTypeId mockDisplayPinDoubleEventTypeId; +extern ParamTypeId mockDisplayPinDoubleEventDoubleParamTypeId; +extern EventTypeId mockDisplayPinBoolEventTypeId; +extern ParamTypeId mockDisplayPinBoolEventBoolParamTypeId; +extern ActionTypeId mockDisplayPinColorActionTypeId; +extern ParamTypeId mockDisplayPinColorActionColorParamTypeId; +extern ActionTypeId mockDisplayPinPercentageActionTypeId; +extern ParamTypeId mockDisplayPinPercentageActionPercentageParamTypeId; +extern ActionTypeId mockDisplayPinAllowedValuesActionTypeId; +extern ParamTypeId mockDisplayPinAllowedValuesActionAllowedValuesParamTypeId; +extern ActionTypeId mockDisplayPinDoubleActionTypeId; +extern ParamTypeId mockDisplayPinDoubleActionDoubleParamTypeId; +extern ActionTypeId mockDisplayPinBoolActionTypeId; +extern ParamTypeId mockDisplayPinBoolActionBoolParamTypeId; +extern ActionTypeId mockDisplayPinTimeoutActionTypeId; +extern DeviceClassId mockParentDeviceClassId; +extern StateTypeId mockParentBoolValueStateTypeId; +extern EventTypeId mockParentBoolValueEventTypeId; +extern ParamTypeId mockParentBoolValueEventBoolValueParamTypeId; +extern ActionTypeId mockParentBoolValueActionTypeId; +extern ParamTypeId mockParentBoolValueActionBoolValueParamTypeId; +extern DeviceClassId mockChildDeviceClassId; +extern StateTypeId mockChildBoolValueStateTypeId; +extern EventTypeId mockChildBoolValueEventTypeId; +extern ParamTypeId mockChildBoolValueEventBoolValueParamTypeId; +extern ActionTypeId mockChildBoolValueActionTypeId; +extern ParamTypeId mockChildBoolValueActionBoolValueParamTypeId; +extern DeviceClassId mockInputTypeDeviceClassId; +extern ParamTypeId mockInputTypeDeviceTextLineParamTypeId; +extern ParamTypeId mockInputTypeDeviceTextAreaParamTypeId; +extern ParamTypeId mockInputTypeDevicePasswordParamTypeId; +extern ParamTypeId mockInputTypeDeviceSearchParamTypeId; +extern ParamTypeId mockInputTypeDeviceMailParamTypeId; +extern ParamTypeId mockInputTypeDeviceIp4ParamTypeId; +extern ParamTypeId mockInputTypeDeviceIp6ParamTypeId; +extern ParamTypeId mockInputTypeDeviceUrlParamTypeId; +extern ParamTypeId mockInputTypeDeviceMacParamTypeId; +extern StateTypeId mockInputTypeBoolStateTypeId; +extern StateTypeId mockInputTypeWritableBoolStateTypeId; +extern StateTypeId mockInputTypeIntStateTypeId; +extern StateTypeId mockInputTypeWritableIntStateTypeId; +extern StateTypeId mockInputTypeWritableIntMinMaxStateTypeId; +extern StateTypeId mockInputTypeUintStateTypeId; +extern StateTypeId mockInputTypeWritableUIntStateTypeId; +extern StateTypeId mockInputTypeWritableUIntMinMaxStateTypeId; +extern StateTypeId mockInputTypeDoubleStateTypeId; +extern StateTypeId mockInputTypeWritableDoubleStateTypeId; +extern StateTypeId mockInputTypeWritableDoubleMinMaxStateTypeId; +extern StateTypeId mockInputTypeStringStateTypeId; +extern StateTypeId mockInputTypeWritableStringStateTypeId; +extern StateTypeId mockInputTypeWritableStringSelectionStateTypeId; +extern StateTypeId mockInputTypeColorStateTypeId; +extern StateTypeId mockInputTypeWritableColorStateTypeId; +extern StateTypeId mockInputTypeTimeStateTypeId; +extern StateTypeId mockInputTypeWritableTimeStateTypeId; +extern StateTypeId mockInputTypeTimestampIntStateTypeId; +extern StateTypeId mockInputTypeWritableTimestampIntStateTypeId; +extern StateTypeId mockInputTypeTimestampUIntStateTypeId; +extern StateTypeId mockInputTypeWritableTimestampUIntStateTypeId; +extern EventTypeId mockInputTypeBoolEventTypeId; +extern ParamTypeId mockInputTypeBoolEventBoolParamTypeId; +extern EventTypeId mockInputTypeWritableBoolEventTypeId; +extern ParamTypeId mockInputTypeWritableBoolEventWritableBoolParamTypeId; +extern EventTypeId mockInputTypeIntEventTypeId; +extern ParamTypeId mockInputTypeIntEventIntParamTypeId; +extern EventTypeId mockInputTypeWritableIntEventTypeId; +extern ParamTypeId mockInputTypeWritableIntEventWritableIntParamTypeId; +extern EventTypeId mockInputTypeWritableIntMinMaxEventTypeId; +extern ParamTypeId mockInputTypeWritableIntMinMaxEventWritableIntMinMaxParamTypeId; +extern EventTypeId mockInputTypeUintEventTypeId; +extern ParamTypeId mockInputTypeUintEventUintParamTypeId; +extern EventTypeId mockInputTypeWritableUIntEventTypeId; +extern ParamTypeId mockInputTypeWritableUIntEventWritableUIntParamTypeId; +extern EventTypeId mockInputTypeWritableUIntMinMaxEventTypeId; +extern ParamTypeId mockInputTypeWritableUIntMinMaxEventWritableUIntMinMaxParamTypeId; +extern EventTypeId mockInputTypeDoubleEventTypeId; +extern ParamTypeId mockInputTypeDoubleEventDoubleParamTypeId; +extern EventTypeId mockInputTypeWritableDoubleEventTypeId; +extern ParamTypeId mockInputTypeWritableDoubleEventWritableDoubleParamTypeId; +extern EventTypeId mockInputTypeWritableDoubleMinMaxEventTypeId; +extern ParamTypeId mockInputTypeWritableDoubleMinMaxEventWritableDoubleMinMaxParamTypeId; +extern EventTypeId mockInputTypeStringEventTypeId; +extern ParamTypeId mockInputTypeStringEventStringParamTypeId; +extern EventTypeId mockInputTypeWritableStringEventTypeId; +extern ParamTypeId mockInputTypeWritableStringEventWritableStringParamTypeId; +extern EventTypeId mockInputTypeWritableStringSelectionEventTypeId; +extern ParamTypeId mockInputTypeWritableStringSelectionEventWritableStringSelectionParamTypeId; +extern EventTypeId mockInputTypeColorEventTypeId; +extern ParamTypeId mockInputTypeColorEventColorParamTypeId; +extern EventTypeId mockInputTypeWritableColorEventTypeId; +extern ParamTypeId mockInputTypeWritableColorEventWritableColorParamTypeId; +extern EventTypeId mockInputTypeTimeEventTypeId; +extern ParamTypeId mockInputTypeTimeEventTimeParamTypeId; +extern EventTypeId mockInputTypeWritableTimeEventTypeId; +extern ParamTypeId mockInputTypeWritableTimeEventWritableTimeParamTypeId; +extern EventTypeId mockInputTypeTimestampIntEventTypeId; +extern ParamTypeId mockInputTypeTimestampIntEventTimestampIntParamTypeId; +extern EventTypeId mockInputTypeWritableTimestampIntEventTypeId; +extern ParamTypeId mockInputTypeWritableTimestampIntEventWritableTimestampIntParamTypeId; +extern EventTypeId mockInputTypeTimestampUIntEventTypeId; +extern ParamTypeId mockInputTypeTimestampUIntEventTimestampUIntParamTypeId; +extern EventTypeId mockInputTypeWritableTimestampUIntEventTypeId; +extern ParamTypeId mockInputTypeWritableTimestampUIntEventWritableTimestampUIntParamTypeId; +extern ActionTypeId mockInputTypeWritableBoolActionTypeId; +extern ParamTypeId mockInputTypeWritableBoolActionWritableBoolParamTypeId; +extern ActionTypeId mockInputTypeWritableIntActionTypeId; +extern ParamTypeId mockInputTypeWritableIntActionWritableIntParamTypeId; +extern ActionTypeId mockInputTypeWritableIntMinMaxActionTypeId; +extern ParamTypeId mockInputTypeWritableIntMinMaxActionWritableIntMinMaxParamTypeId; +extern ActionTypeId mockInputTypeWritableUIntActionTypeId; +extern ParamTypeId mockInputTypeWritableUIntActionWritableUIntParamTypeId; +extern ActionTypeId mockInputTypeWritableUIntMinMaxActionTypeId; +extern ParamTypeId mockInputTypeWritableUIntMinMaxActionWritableUIntMinMaxParamTypeId; +extern ActionTypeId mockInputTypeWritableDoubleActionTypeId; +extern ParamTypeId mockInputTypeWritableDoubleActionWritableDoubleParamTypeId; +extern ActionTypeId mockInputTypeWritableDoubleMinMaxActionTypeId; +extern ParamTypeId mockInputTypeWritableDoubleMinMaxActionWritableDoubleMinMaxParamTypeId; +extern ActionTypeId mockInputTypeWritableStringActionTypeId; +extern ParamTypeId mockInputTypeWritableStringActionWritableStringParamTypeId; +extern ActionTypeId mockInputTypeWritableStringSelectionActionTypeId; +extern ParamTypeId mockInputTypeWritableStringSelectionActionWritableStringSelectionParamTypeId; +extern ActionTypeId mockInputTypeWritableColorActionTypeId; +extern ParamTypeId mockInputTypeWritableColorActionWritableColorParamTypeId; +extern ActionTypeId mockInputTypeWritableTimeActionTypeId; +extern ParamTypeId mockInputTypeWritableTimeActionWritableTimeParamTypeId; +extern ActionTypeId mockInputTypeWritableTimestampIntActionTypeId; +extern ParamTypeId mockInputTypeWritableTimestampIntActionWritableTimestampIntParamTypeId; +extern ActionTypeId mockInputTypeWritableTimestampUIntActionTypeId; +extern ParamTypeId mockInputTypeWritableTimestampUIntActionWritableTimestampUIntParamTypeId; + +#endif // EXTERNPLUGININFO_H diff --git a/plugins/mock/plugininfo.h b/plugins/mock/plugininfo.h new file mode 100644 index 00000000..1156cb1b --- /dev/null +++ b/plugins/mock/plugininfo.h @@ -0,0 +1,950 @@ +/* This file is generated by the nymea build system. Any changes to this file will * + * be lost. If you want to change this file, edit the plugin's json file. */ + +#ifndef PLUGININFO_H +#define PLUGININFO_H + +#include "typeutils.h" + +#include +#include + +extern "C" const QString libnymea_api_version = QString("2.1.0"); + +Q_DECLARE_LOGGING_CATEGORY(dcMockDevice) +Q_LOGGING_CATEGORY(dcMockDevice, "MockDevice") + +PluginId pluginId = PluginId("{727a4a9a-c187-446f-aadf-f1b2220607d1}"); +ParamTypeId mockDevicePluginConfigParamIntParamTypeId = ParamTypeId("{e1f72121-a426-45e2-b475-8262b5cdf103}"); +ParamTypeId mockDevicePluginConfigParamBoolParamTypeId = ParamTypeId("{c75723b6-ea4f-4982-9751-6c5e39c88145}"); +VendorId nymeaVendorId = VendorId("{2062d64d-3232-433c-88bc-0d33c0ba2ba6}"); +DeviceClassId mockDeviceClassId = DeviceClassId("{753f0d32-0468-4d08-82ed-1964aab03298}"); +ParamTypeId mockDeviceHttpportParamTypeId = ParamTypeId("{d4f06047-125e-4479-9810-b54c189917f5}"); +ParamTypeId mockDeviceAsyncParamTypeId = ParamTypeId("{f2977061-4dd0-4ef5-85aa-3b7134743be3}"); +ParamTypeId mockDeviceBrokenParamTypeId = ParamTypeId("{ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4}"); +ParamTypeId mockSettingsSetting1ParamTypeId = ParamTypeId("{367f7ba4-5039-47be-abd8-59cc8eaf4b9a}"); +ParamTypeId mockDiscoveryResultCountParamTypeId = ParamTypeId("{d222adb4-2f9c-4c3f-8655-76400d0fb6ce}"); +StateTypeId mockIntStateTypeId = StateTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +StateTypeId mockBoolStateTypeId = StateTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +StateTypeId mockDoubleStateTypeId = StateTypeId("{7cac53ee-7048-4dc9-b000-7b585390f34c}"); +StateTypeId mockBatteryLevelStateTypeId = StateTypeId("{6c8ab9a6-0164-4795-b829-f4394fe4edc4}"); +StateTypeId mockBatteryCriticalStateTypeId = StateTypeId("{580bc611-1a55-41f3-996f-8d3ccf543db3}"); +StateTypeId mockPowerStateTypeId = StateTypeId("{064aed0d-da4c-49d4-b236-60f97e98ff84}"); +EventTypeId mockIntEventTypeId = EventTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +ParamTypeId mockIntEventIntParamTypeId = ParamTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +EventTypeId mockBoolEventTypeId = EventTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +ParamTypeId mockBoolEventBoolParamTypeId = ParamTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +EventTypeId mockDoubleEventTypeId = EventTypeId("{7cac53ee-7048-4dc9-b000-7b585390f34c}"); +ParamTypeId mockDoubleEventDoubleParamTypeId = ParamTypeId("{7cac53ee-7048-4dc9-b000-7b585390f34c}"); +EventTypeId mockBatteryLevelEventTypeId = EventTypeId("{6c8ab9a6-0164-4795-b829-f4394fe4edc4}"); +ParamTypeId mockBatteryLevelEventBatteryLevelParamTypeId = ParamTypeId("{6c8ab9a6-0164-4795-b829-f4394fe4edc4}"); +EventTypeId mockBatteryCriticalEventTypeId = EventTypeId("{580bc611-1a55-41f3-996f-8d3ccf543db3}"); +ParamTypeId mockBatteryCriticalEventBatteryCriticalParamTypeId = ParamTypeId("{580bc611-1a55-41f3-996f-8d3ccf543db3}"); +EventTypeId mockPowerEventTypeId = EventTypeId("{064aed0d-da4c-49d4-b236-60f97e98ff84}"); +ParamTypeId mockPowerEventPowerParamTypeId = ParamTypeId("{064aed0d-da4c-49d4-b236-60f97e98ff84}"); +EventTypeId mockMockEvent1EventTypeId = EventTypeId("{45bf3752-0fc6-46b9-89fd-ffd878b5b22b}"); +EventTypeId mockMockEvent2EventTypeId = EventTypeId("{863d5920-b1cf-4eb9-88bd-8f7b8583b1cf}"); +ParamTypeId mockMockEvent2EventMockParamIntParamTypeId = ParamTypeId("{0550e16d-60b9-4ba5-83f4-4d3cee656121}"); +ActionTypeId mockPowerActionTypeId = ActionTypeId("{064aed0d-da4c-49d4-b236-60f97e98ff84}"); +ParamTypeId mockPowerActionPowerParamTypeId = ParamTypeId("{064aed0d-da4c-49d4-b236-60f97e98ff84}"); +ActionTypeId mockWithParamsActionTypeId = ActionTypeId("{dea0f4e1-65e3-4981-8eaa-2701c53a9185}"); +ParamTypeId mockWithParamsActionMockActionParam1ParamTypeId = ParamTypeId("{a2d3a256-a551-4712-a65b-ecd5a436a1cb}"); +ParamTypeId mockWithParamsActionMockActionParam2ParamTypeId = ParamTypeId("{304a4899-18be-4e3b-94f4-d03be52f3233}"); +ActionTypeId mockWithoutParamsActionTypeId = ActionTypeId("{defd3ed6-1a0d-400b-8879-a0202cf39935}"); +ActionTypeId mockMockAsyncActionTypeId = ActionTypeId("{fbae06d3-7666-483e-a39e-ec50fe89054e}"); +ActionTypeId mockMockFailingActionTypeId = ActionTypeId("{df3cf33d-26d5-4577-9132-9823bd33fad0}"); +ActionTypeId mockMockAsyncFailingActionTypeId = ActionTypeId("{bfe89a1d-3497-4121-8318-e77c37537219}"); +DeviceClassId mockDeviceAutoDeviceClassId = DeviceClassId("{ab4257b3-7548-47ee-9bd4-7dc3004fd197}"); +ParamTypeId mockDeviceAutoDeviceHttpportParamTypeId = ParamTypeId("{d4f06047-125e-4479-9810-b54c189917f5}"); +ParamTypeId mockDeviceAutoDeviceAsyncParamTypeId = ParamTypeId("{f2977061-4dd0-4ef5-85aa-3b7134743be3}"); +ParamTypeId mockDeviceAutoDeviceBrokenParamTypeId = ParamTypeId("{ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4}"); +StateTypeId mockDeviceAutoIntStateTypeId = StateTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +StateTypeId mockDeviceAutoBoolValueStateTypeId = StateTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +EventTypeId mockDeviceAutoIntEventTypeId = EventTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +ParamTypeId mockDeviceAutoIntEventIntParamTypeId = ParamTypeId("{80baec19-54de-4948-ac46-31eabfaceb83}"); +EventTypeId mockDeviceAutoBoolValueEventTypeId = EventTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +ParamTypeId mockDeviceAutoBoolValueEventBoolValueParamTypeId = ParamTypeId("{9dd6a97c-dfd1-43dc-acbd-367932742310}"); +EventTypeId mockDeviceAutoEvent1EventTypeId = EventTypeId("{45bf3752-0fc6-46b9-89fd-ffd878b5b22b}"); +EventTypeId mockDeviceAutoEvent2EventTypeId = EventTypeId("{863d5920-b1cf-4eb9-88bd-8f7b8583b1cf}"); +ParamTypeId mockDeviceAutoEvent2EventMockParamIntParamTypeId = ParamTypeId("{0550e16d-60b9-4ba5-83f4-4d3cee656121}"); +ActionTypeId mockDeviceAutoWithParamsActionTypeId = ActionTypeId("{dea0f4e1-65e3-4981-8eaa-2701c53a9185}"); +ParamTypeId mockDeviceAutoWithParamsActionMockActionParam1ParamTypeId = ParamTypeId("{a2d3a256-a551-4712-a65b-ecd5a436a1cb}"); +ParamTypeId mockDeviceAutoWithParamsActionMockActionParam2ParamTypeId = ParamTypeId("{304a4899-18be-4e3b-94f4-d03be52f3233}"); +ActionTypeId mockDeviceAutoMockActionNoParmsActionTypeId = ActionTypeId("{defd3ed6-1a0d-400b-8879-a0202cf39935}"); +ActionTypeId mockDeviceAutoMockActionAsyncActionTypeId = ActionTypeId("{fbae06d3-7666-483e-a39e-ec50fe89054e}"); +ActionTypeId mockDeviceAutoMockActionBrokenActionTypeId = ActionTypeId("{df3cf33d-26d5-4577-9132-9823bd33fad0}"); +ActionTypeId mockDeviceAutoMockActionAsyncBrokenActionTypeId = ActionTypeId("{bfe89a1d-3497-4121-8318-e77c37537219}"); +DeviceClassId mockPushButtonDeviceClassId = DeviceClassId("{9e03144c-e436-4eea-82d9-ccb33ef778db}"); +ParamTypeId mockPushButtonDiscoveryResultCountParamTypeId = ParamTypeId("{d222adb4-2f9c-4c3f-8655-76400d0fb6ce}"); +StateTypeId mockPushButtonColorStateTypeId = StateTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +StateTypeId mockPushButtonPercentageStateTypeId = StateTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +StateTypeId mockPushButtonAllowedValuesStateTypeId = StateTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +StateTypeId mockPushButtonDoubleStateTypeId = StateTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +StateTypeId mockPushButtonBoolStateTypeId = StateTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +EventTypeId mockPushButtonColorEventTypeId = EventTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ParamTypeId mockPushButtonColorEventColorParamTypeId = ParamTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +EventTypeId mockPushButtonPercentageEventTypeId = EventTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ParamTypeId mockPushButtonPercentageEventPercentageParamTypeId = ParamTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +EventTypeId mockPushButtonAllowedValuesEventTypeId = EventTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ParamTypeId mockPushButtonAllowedValuesEventAllowedValuesParamTypeId = ParamTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +EventTypeId mockPushButtonDoubleEventTypeId = EventTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ParamTypeId mockPushButtonDoubleEventDoubleParamTypeId = ParamTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +EventTypeId mockPushButtonBoolEventTypeId = EventTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ParamTypeId mockPushButtonBoolEventBoolParamTypeId = ParamTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ActionTypeId mockPushButtonColorActionTypeId = ActionTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ParamTypeId mockPushButtonColorActionColorParamTypeId = ParamTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ActionTypeId mockPushButtonPercentageActionTypeId = ActionTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ParamTypeId mockPushButtonPercentageActionPercentageParamTypeId = ParamTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ActionTypeId mockPushButtonAllowedValuesActionTypeId = ActionTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ParamTypeId mockPushButtonAllowedValuesActionAllowedValuesParamTypeId = ParamTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ActionTypeId mockPushButtonDoubleActionTypeId = ActionTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ParamTypeId mockPushButtonDoubleActionDoubleParamTypeId = ParamTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ActionTypeId mockPushButtonBoolActionTypeId = ActionTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ParamTypeId mockPushButtonBoolActionBoolParamTypeId = ParamTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ActionTypeId mockPushButtonTimeoutActionTypeId = ActionTypeId("{54646e7c-bc54-4895-81a2-590d72d120f9}"); +DeviceClassId mockDisplayPinDeviceClassId = DeviceClassId("{296f1fd4-e893-46b2-8a42-50d1bceb8730}"); +ParamTypeId mockDisplayPinDevicePinParamTypeId = ParamTypeId("{da820e07-22dc-4173-9c07-2f49a4e265f9}"); +ParamTypeId mockDisplayPinDiscoveryResultCountParamTypeId = ParamTypeId("{d222adb4-2f9c-4c3f-8655-76400d0fb6ce}"); +StateTypeId mockDisplayPinColorStateTypeId = StateTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +StateTypeId mockDisplayPinPercentageStateTypeId = StateTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +StateTypeId mockDisplayPinAllowedValuesStateTypeId = StateTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +StateTypeId mockDisplayPinDoubleStateTypeId = StateTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +StateTypeId mockDisplayPinBoolStateTypeId = StateTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +EventTypeId mockDisplayPinColorEventTypeId = EventTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ParamTypeId mockDisplayPinColorEventColorParamTypeId = ParamTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +EventTypeId mockDisplayPinPercentageEventTypeId = EventTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ParamTypeId mockDisplayPinPercentageEventPercentageParamTypeId = ParamTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +EventTypeId mockDisplayPinAllowedValuesEventTypeId = EventTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ParamTypeId mockDisplayPinAllowedValuesEventAllowedValuesParamTypeId = ParamTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +EventTypeId mockDisplayPinDoubleEventTypeId = EventTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ParamTypeId mockDisplayPinDoubleEventDoubleParamTypeId = ParamTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +EventTypeId mockDisplayPinBoolEventTypeId = EventTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ParamTypeId mockDisplayPinBoolEventBoolParamTypeId = ParamTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ActionTypeId mockDisplayPinColorActionTypeId = ActionTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ParamTypeId mockDisplayPinColorActionColorParamTypeId = ParamTypeId("{20dc7c22-c50e-42db-837c-2bbced939f8e}"); +ActionTypeId mockDisplayPinPercentageActionTypeId = ActionTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ParamTypeId mockDisplayPinPercentageActionPercentageParamTypeId = ParamTypeId("{72981c04-267a-4ba0-a59e-9921d2f3af9c}"); +ActionTypeId mockDisplayPinAllowedValuesActionTypeId = ActionTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ParamTypeId mockDisplayPinAllowedValuesActionAllowedValuesParamTypeId = ParamTypeId("{05f63f9c-f61e-4dcf-ad55-3f13fde2765b}"); +ActionTypeId mockDisplayPinDoubleActionTypeId = ActionTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ParamTypeId mockDisplayPinDoubleActionDoubleParamTypeId = ParamTypeId("{53cd7c55-49b7-441b-b970-9048f20f0e2c}"); +ActionTypeId mockDisplayPinBoolActionTypeId = ActionTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ParamTypeId mockDisplayPinBoolActionBoolParamTypeId = ParamTypeId("{e680f7a4-b39e-46da-be41-fa3170fe3768}"); +ActionTypeId mockDisplayPinTimeoutActionTypeId = ActionTypeId("{54646e7c-bc54-4895-81a2-590d72d120f9}"); +DeviceClassId mockParentDeviceClassId = DeviceClassId("{a71fbde9-9a38-4bf8-beab-c8aade2608ba}"); +StateTypeId mockParentBoolValueStateTypeId = StateTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +EventTypeId mockParentBoolValueEventTypeId = EventTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ParamTypeId mockParentBoolValueEventBoolValueParamTypeId = ParamTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ActionTypeId mockParentBoolValueActionTypeId = ActionTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ParamTypeId mockParentBoolValueActionBoolValueParamTypeId = ParamTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +DeviceClassId mockChildDeviceClassId = DeviceClassId("{40893c9f-bc47-40c1-8bf7-b390c7c1b4fc}"); +StateTypeId mockChildBoolValueStateTypeId = StateTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +EventTypeId mockChildBoolValueEventTypeId = EventTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ParamTypeId mockChildBoolValueEventBoolValueParamTypeId = ParamTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ActionTypeId mockChildBoolValueActionTypeId = ActionTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +ParamTypeId mockChildBoolValueActionBoolValueParamTypeId = ParamTypeId("{d24ede5f-4064-4898-bb84-cfb533b1fbc0}"); +DeviceClassId mockInputTypeDeviceClassId = DeviceClassId("{515ffdf1-55e5-498d-9abc-4e2fe768f3a9}"); +ParamTypeId mockInputTypeDeviceTextLineParamTypeId = ParamTypeId("{e6acf0c7-4b8e-4296-ac62-855d20deb816}"); +ParamTypeId mockInputTypeDeviceTextAreaParamTypeId = ParamTypeId("{716f0994-bc01-42b0-b64d-59236f7320d2}"); +ParamTypeId mockInputTypeDevicePasswordParamTypeId = ParamTypeId("{e5c0d14b-c9f1-4aca-a56e-85bfa6977150}"); +ParamTypeId mockInputTypeDeviceSearchParamTypeId = ParamTypeId("{22add8c9-ee4f-43ad-8931-58e999313ac3}"); +ParamTypeId mockInputTypeDeviceMailParamTypeId = ParamTypeId("{a8494faf-3a0f-4cf3-84b7-4b39148a838d}"); +ParamTypeId mockInputTypeDeviceIp4ParamTypeId = ParamTypeId("{9e5f86a0-4bb3-4892-bff8-3fc4032af6e2}"); +ParamTypeId mockInputTypeDeviceIp6ParamTypeId = ParamTypeId("{43bf3832-dd48-4090-a836-656e8b60216e}"); +ParamTypeId mockInputTypeDeviceUrlParamTypeId = ParamTypeId("{fa67229f-fcef-496f-b671-59a4b48f3ab5}"); +ParamTypeId mockInputTypeDeviceMacParamTypeId = ParamTypeId("{e93db587-7919-48f3-8c88-1651de63c765}"); +StateTypeId mockInputTypeBoolStateTypeId = StateTypeId("{3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}"); +StateTypeId mockInputTypeWritableBoolStateTypeId = StateTypeId("{a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}"); +StateTypeId mockInputTypeIntStateTypeId = StateTypeId("{d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}"); +StateTypeId mockInputTypeWritableIntStateTypeId = StateTypeId("{857a8422-983c-47d6-a15f-d8450b3162f7}"); +StateTypeId mockInputTypeWritableIntMinMaxStateTypeId = StateTypeId("{86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}"); +StateTypeId mockInputTypeUintStateTypeId = StateTypeId("{19e74fcc-bfd5-491f-8eb6-af128e8f1162}"); +StateTypeId mockInputTypeWritableUIntStateTypeId = StateTypeId("{563e9c4c-5198-400a-9f6c-358f4752af58}"); +StateTypeId mockInputTypeWritableUIntMinMaxStateTypeId = StateTypeId("{79238998-eaab-4d71-b406-5d78f1749751}"); +StateTypeId mockInputTypeDoubleStateTypeId = StateTypeId("{f7d2063d-959e-46ac-8568-8b99722d3b22}"); +StateTypeId mockInputTypeWritableDoubleStateTypeId = StateTypeId("{8e2eb91b-d60b-4461-9a50-d7b8ad263170}"); +StateTypeId mockInputTypeWritableDoubleMinMaxStateTypeId = StateTypeId("{00d3425e-1da6-4748-8906-4555ceefb136}"); +StateTypeId mockInputTypeStringStateTypeId = StateTypeId("{27f69ca9-a321-40ff-bfee-4b0272a671b4}"); +StateTypeId mockInputTypeWritableStringStateTypeId = StateTypeId("{ef511043-bd1a-4a5f-984c-222b7da43f38}"); +StateTypeId mockInputTypeWritableStringSelectionStateTypeId = StateTypeId("{209d7afc-6fe9-4fe9-939b-e472ea0ad639}"); +StateTypeId mockInputTypeColorStateTypeId = StateTypeId("{4507d5c6-b692-4bd6-87f2-00364bc0cb4d}"); +StateTypeId mockInputTypeWritableColorStateTypeId = StateTypeId("{455f4f68-3cb0-4e8a-a707-62e4a2a8035c}"); +StateTypeId mockInputTypeTimeStateTypeId = StateTypeId("{8250c71e-59bc-41ab-b576-99fcfc34e8d1}"); +StateTypeId mockInputTypeWritableTimeStateTypeId = StateTypeId("{d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}"); +StateTypeId mockInputTypeTimestampIntStateTypeId = StateTypeId("{2c91b5ef-c2d1-4367-bc65-5a13abf69641}"); +StateTypeId mockInputTypeWritableTimestampIntStateTypeId = StateTypeId("{88b6746a-b009-4df6-8986-d7884ffd94b2}"); +StateTypeId mockInputTypeTimestampUIntStateTypeId = StateTypeId("{6c9a96e8-0d48-4f42-8967-848358fd7f79}"); +StateTypeId mockInputTypeWritableTimestampUIntStateTypeId = StateTypeId("{45d0069a-63ac-4265-8170-8152778608ee}"); +EventTypeId mockInputTypeBoolEventTypeId = EventTypeId("{3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}"); +ParamTypeId mockInputTypeBoolEventBoolParamTypeId = ParamTypeId("{3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}"); +EventTypeId mockInputTypeWritableBoolEventTypeId = EventTypeId("{a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}"); +ParamTypeId mockInputTypeWritableBoolEventWritableBoolParamTypeId = ParamTypeId("{a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}"); +EventTypeId mockInputTypeIntEventTypeId = EventTypeId("{d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}"); +ParamTypeId mockInputTypeIntEventIntParamTypeId = ParamTypeId("{d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}"); +EventTypeId mockInputTypeWritableIntEventTypeId = EventTypeId("{857a8422-983c-47d6-a15f-d8450b3162f7}"); +ParamTypeId mockInputTypeWritableIntEventWritableIntParamTypeId = ParamTypeId("{857a8422-983c-47d6-a15f-d8450b3162f7}"); +EventTypeId mockInputTypeWritableIntMinMaxEventTypeId = EventTypeId("{86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}"); +ParamTypeId mockInputTypeWritableIntMinMaxEventWritableIntMinMaxParamTypeId = ParamTypeId("{86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}"); +EventTypeId mockInputTypeUintEventTypeId = EventTypeId("{19e74fcc-bfd5-491f-8eb6-af128e8f1162}"); +ParamTypeId mockInputTypeUintEventUintParamTypeId = ParamTypeId("{19e74fcc-bfd5-491f-8eb6-af128e8f1162}"); +EventTypeId mockInputTypeWritableUIntEventTypeId = EventTypeId("{563e9c4c-5198-400a-9f6c-358f4752af58}"); +ParamTypeId mockInputTypeWritableUIntEventWritableUIntParamTypeId = ParamTypeId("{563e9c4c-5198-400a-9f6c-358f4752af58}"); +EventTypeId mockInputTypeWritableUIntMinMaxEventTypeId = EventTypeId("{79238998-eaab-4d71-b406-5d78f1749751}"); +ParamTypeId mockInputTypeWritableUIntMinMaxEventWritableUIntMinMaxParamTypeId = ParamTypeId("{79238998-eaab-4d71-b406-5d78f1749751}"); +EventTypeId mockInputTypeDoubleEventTypeId = EventTypeId("{f7d2063d-959e-46ac-8568-8b99722d3b22}"); +ParamTypeId mockInputTypeDoubleEventDoubleParamTypeId = ParamTypeId("{f7d2063d-959e-46ac-8568-8b99722d3b22}"); +EventTypeId mockInputTypeWritableDoubleEventTypeId = EventTypeId("{8e2eb91b-d60b-4461-9a50-d7b8ad263170}"); +ParamTypeId mockInputTypeWritableDoubleEventWritableDoubleParamTypeId = ParamTypeId("{8e2eb91b-d60b-4461-9a50-d7b8ad263170}"); +EventTypeId mockInputTypeWritableDoubleMinMaxEventTypeId = EventTypeId("{00d3425e-1da6-4748-8906-4555ceefb136}"); +ParamTypeId mockInputTypeWritableDoubleMinMaxEventWritableDoubleMinMaxParamTypeId = ParamTypeId("{00d3425e-1da6-4748-8906-4555ceefb136}"); +EventTypeId mockInputTypeStringEventTypeId = EventTypeId("{27f69ca9-a321-40ff-bfee-4b0272a671b4}"); +ParamTypeId mockInputTypeStringEventStringParamTypeId = ParamTypeId("{27f69ca9-a321-40ff-bfee-4b0272a671b4}"); +EventTypeId mockInputTypeWritableStringEventTypeId = EventTypeId("{ef511043-bd1a-4a5f-984c-222b7da43f38}"); +ParamTypeId mockInputTypeWritableStringEventWritableStringParamTypeId = ParamTypeId("{ef511043-bd1a-4a5f-984c-222b7da43f38}"); +EventTypeId mockInputTypeWritableStringSelectionEventTypeId = EventTypeId("{209d7afc-6fe9-4fe9-939b-e472ea0ad639}"); +ParamTypeId mockInputTypeWritableStringSelectionEventWritableStringSelectionParamTypeId = ParamTypeId("{209d7afc-6fe9-4fe9-939b-e472ea0ad639}"); +EventTypeId mockInputTypeColorEventTypeId = EventTypeId("{4507d5c6-b692-4bd6-87f2-00364bc0cb4d}"); +ParamTypeId mockInputTypeColorEventColorParamTypeId = ParamTypeId("{4507d5c6-b692-4bd6-87f2-00364bc0cb4d}"); +EventTypeId mockInputTypeWritableColorEventTypeId = EventTypeId("{455f4f68-3cb0-4e8a-a707-62e4a2a8035c}"); +ParamTypeId mockInputTypeWritableColorEventWritableColorParamTypeId = ParamTypeId("{455f4f68-3cb0-4e8a-a707-62e4a2a8035c}"); +EventTypeId mockInputTypeTimeEventTypeId = EventTypeId("{8250c71e-59bc-41ab-b576-99fcfc34e8d1}"); +ParamTypeId mockInputTypeTimeEventTimeParamTypeId = ParamTypeId("{8250c71e-59bc-41ab-b576-99fcfc34e8d1}"); +EventTypeId mockInputTypeWritableTimeEventTypeId = EventTypeId("{d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}"); +ParamTypeId mockInputTypeWritableTimeEventWritableTimeParamTypeId = ParamTypeId("{d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}"); +EventTypeId mockInputTypeTimestampIntEventTypeId = EventTypeId("{2c91b5ef-c2d1-4367-bc65-5a13abf69641}"); +ParamTypeId mockInputTypeTimestampIntEventTimestampIntParamTypeId = ParamTypeId("{2c91b5ef-c2d1-4367-bc65-5a13abf69641}"); +EventTypeId mockInputTypeWritableTimestampIntEventTypeId = EventTypeId("{88b6746a-b009-4df6-8986-d7884ffd94b2}"); +ParamTypeId mockInputTypeWritableTimestampIntEventWritableTimestampIntParamTypeId = ParamTypeId("{88b6746a-b009-4df6-8986-d7884ffd94b2}"); +EventTypeId mockInputTypeTimestampUIntEventTypeId = EventTypeId("{6c9a96e8-0d48-4f42-8967-848358fd7f79}"); +ParamTypeId mockInputTypeTimestampUIntEventTimestampUIntParamTypeId = ParamTypeId("{6c9a96e8-0d48-4f42-8967-848358fd7f79}"); +EventTypeId mockInputTypeWritableTimestampUIntEventTypeId = EventTypeId("{45d0069a-63ac-4265-8170-8152778608ee}"); +ParamTypeId mockInputTypeWritableTimestampUIntEventWritableTimestampUIntParamTypeId = ParamTypeId("{45d0069a-63ac-4265-8170-8152778608ee}"); +ActionTypeId mockInputTypeWritableBoolActionTypeId = ActionTypeId("{a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}"); +ParamTypeId mockInputTypeWritableBoolActionWritableBoolParamTypeId = ParamTypeId("{a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}"); +ActionTypeId mockInputTypeWritableIntActionTypeId = ActionTypeId("{857a8422-983c-47d6-a15f-d8450b3162f7}"); +ParamTypeId mockInputTypeWritableIntActionWritableIntParamTypeId = ParamTypeId("{857a8422-983c-47d6-a15f-d8450b3162f7}"); +ActionTypeId mockInputTypeWritableIntMinMaxActionTypeId = ActionTypeId("{86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}"); +ParamTypeId mockInputTypeWritableIntMinMaxActionWritableIntMinMaxParamTypeId = ParamTypeId("{86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}"); +ActionTypeId mockInputTypeWritableUIntActionTypeId = ActionTypeId("{563e9c4c-5198-400a-9f6c-358f4752af58}"); +ParamTypeId mockInputTypeWritableUIntActionWritableUIntParamTypeId = ParamTypeId("{563e9c4c-5198-400a-9f6c-358f4752af58}"); +ActionTypeId mockInputTypeWritableUIntMinMaxActionTypeId = ActionTypeId("{79238998-eaab-4d71-b406-5d78f1749751}"); +ParamTypeId mockInputTypeWritableUIntMinMaxActionWritableUIntMinMaxParamTypeId = ParamTypeId("{79238998-eaab-4d71-b406-5d78f1749751}"); +ActionTypeId mockInputTypeWritableDoubleActionTypeId = ActionTypeId("{8e2eb91b-d60b-4461-9a50-d7b8ad263170}"); +ParamTypeId mockInputTypeWritableDoubleActionWritableDoubleParamTypeId = ParamTypeId("{8e2eb91b-d60b-4461-9a50-d7b8ad263170}"); +ActionTypeId mockInputTypeWritableDoubleMinMaxActionTypeId = ActionTypeId("{00d3425e-1da6-4748-8906-4555ceefb136}"); +ParamTypeId mockInputTypeWritableDoubleMinMaxActionWritableDoubleMinMaxParamTypeId = ParamTypeId("{00d3425e-1da6-4748-8906-4555ceefb136}"); +ActionTypeId mockInputTypeWritableStringActionTypeId = ActionTypeId("{ef511043-bd1a-4a5f-984c-222b7da43f38}"); +ParamTypeId mockInputTypeWritableStringActionWritableStringParamTypeId = ParamTypeId("{ef511043-bd1a-4a5f-984c-222b7da43f38}"); +ActionTypeId mockInputTypeWritableStringSelectionActionTypeId = ActionTypeId("{209d7afc-6fe9-4fe9-939b-e472ea0ad639}"); +ParamTypeId mockInputTypeWritableStringSelectionActionWritableStringSelectionParamTypeId = ParamTypeId("{209d7afc-6fe9-4fe9-939b-e472ea0ad639}"); +ActionTypeId mockInputTypeWritableColorActionTypeId = ActionTypeId("{455f4f68-3cb0-4e8a-a707-62e4a2a8035c}"); +ParamTypeId mockInputTypeWritableColorActionWritableColorParamTypeId = ParamTypeId("{455f4f68-3cb0-4e8a-a707-62e4a2a8035c}"); +ActionTypeId mockInputTypeWritableTimeActionTypeId = ActionTypeId("{d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}"); +ParamTypeId mockInputTypeWritableTimeActionWritableTimeParamTypeId = ParamTypeId("{d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}"); +ActionTypeId mockInputTypeWritableTimestampIntActionTypeId = ActionTypeId("{88b6746a-b009-4df6-8986-d7884ffd94b2}"); +ParamTypeId mockInputTypeWritableTimestampIntActionWritableTimestampIntParamTypeId = ParamTypeId("{88b6746a-b009-4df6-8986-d7884ffd94b2}"); +ActionTypeId mockInputTypeWritableTimestampUIntActionTypeId = ActionTypeId("{45d0069a-63ac-4265-8170-8152778608ee}"); +ParamTypeId mockInputTypeWritableTimestampUIntActionWritableTimestampUIntParamTypeId = ParamTypeId("{45d0069a-63ac-4265-8170-8152778608ee}"); + +const QString translations[] { + //: The name of the ParamType (DeviceClass: mockInputType, EventType: bool, ID: {3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}) + QT_TRANSLATE_NOOP("mockDevice", "Bool"), + + //: The name of the StateType ({3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Bool"), + + //: The name of the EventType ({3bad3a09-5826-4ed7-a832-10e3e2ee2a7d}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Bool changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: color, ID: {4507d5c6-b692-4bd6-87f2-00364bc0cb4d}) + QT_TRANSLATE_NOOP("mockDevice", "Color"), + + //: The name of the StateType ({4507d5c6-b692-4bd6-87f2-00364bc0cb4d}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Color"), + + //: The name of the EventType ({4507d5c6-b692-4bd6-87f2-00364bc0cb4d}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Color changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: double, ID: {f7d2063d-959e-46ac-8568-8b99722d3b22}) + QT_TRANSLATE_NOOP("mockDevice", "Double"), + + //: The name of the StateType ({f7d2063d-959e-46ac-8568-8b99722d3b22}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Double"), + + //: The name of the EventType ({f7d2063d-959e-46ac-8568-8b99722d3b22}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Double changed"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, EventType: boolValue, ID: {9dd6a97c-dfd1-43dc-acbd-367932742310}) + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state"), + + //: The name of the StateType ({9dd6a97c-dfd1-43dc-acbd-367932742310}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state"), + + //: The name of the ParamType (DeviceClass: mock, EventType: bool, ID: {9dd6a97c-dfd1-43dc-acbd-367932742310}) + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state"), + + //: The name of the StateType ({9dd6a97c-dfd1-43dc-acbd-367932742310}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state"), + + //: The name of the EventType ({9dd6a97c-dfd1-43dc-acbd-367932742310}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state changed"), + + //: The name of the EventType ({9dd6a97c-dfd1-43dc-acbd-367932742310}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy bool state changed"), + + //: The name of the ParamType (DeviceClass: mock, EventType: double, ID: {7cac53ee-7048-4dc9-b000-7b585390f34c}) + QT_TRANSLATE_NOOP("mockDevice", "Dummy double state"), + + //: The name of the StateType ({7cac53ee-7048-4dc9-b000-7b585390f34c}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy double state"), + + //: The name of the EventType ({7cac53ee-7048-4dc9-b000-7b585390f34c}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy double state changed"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, EventType: int, ID: {80baec19-54de-4948-ac46-31eabfaceb83}) + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state"), + + //: The name of the StateType ({80baec19-54de-4948-ac46-31eabfaceb83}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state"), + + //: The name of the ParamType (DeviceClass: mock, EventType: int, ID: {80baec19-54de-4948-ac46-31eabfaceb83}) + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state"), + + //: The name of the StateType ({80baec19-54de-4948-ac46-31eabfaceb83}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state"), + + //: The name of the EventType ({80baec19-54de-4948-ac46-31eabfaceb83}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state changed"), + + //: The name of the EventType ({80baec19-54de-4948-ac46-31eabfaceb83}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Dummy int state changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {9e5f86a0-4bb3-4892-bff8-3fc4032af6e2}) + QT_TRANSLATE_NOOP("mockDevice", "IPv4 address"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {43bf3832-dd48-4090-a836-656e8b60216e}) + QT_TRANSLATE_NOOP("mockDevice", "IPv6 address"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: int, ID: {d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}) + QT_TRANSLATE_NOOP("mockDevice", "Int"), + + //: The name of the StateType ({d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Int"), + + //: The name of the EventType ({d0fc56ae-5791-4e91-b76c-dadfbc7e7dbb}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Int changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {e93db587-7919-48f3-8c88-1651de63c765}) + QT_TRANSLATE_NOOP("mockDevice", "Mac address"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {a8494faf-3a0f-4cf3-84b7-4b39148a838d}) + QT_TRANSLATE_NOOP("mockDevice", "Mail address"), + + //: The name of the ActionType ({dea0f4e1-65e3-4981-8eaa-2701c53a9185}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 1 (with params)"), + + //: The name of the ActionType ({dea0f4e1-65e3-4981-8eaa-2701c53a9185}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 1 (with params)"), + + //: The name of the ActionType ({defd3ed6-1a0d-400b-8879-a0202cf39935}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 2 (without params)"), + + //: The name of the ActionType ({defd3ed6-1a0d-400b-8879-a0202cf39935}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 2 (without params)"), + + //: The name of the ActionType ({fbae06d3-7666-483e-a39e-ec50fe89054e}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 3 (async)"), + + //: The name of the ActionType ({fbae06d3-7666-483e-a39e-ec50fe89054e}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 3 (async)"), + + //: The name of the ActionType ({df3cf33d-26d5-4577-9132-9823bd33fad0}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 4 (broken)"), + + //: The name of the ActionType ({df3cf33d-26d5-4577-9132-9823bd33fad0}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 4 (broken)"), + + //: The name of the ActionType ({bfe89a1d-3497-4121-8318-e77c37537219}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 5 (async, broken)"), + + //: The name of the ActionType ({bfe89a1d-3497-4121-8318-e77c37537219}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Action 5 (async, broken)"), + + //: The name of the DeviceClass ({753f0d32-0468-4d08-82ed-1964aab03298}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device"), + + //: The name of the DeviceClass ({ab4257b3-7548-47ee-9bd4-7dc3004fd197}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (Auto created)"), + + //: The name of the DeviceClass ({40893c9f-bc47-40c1-8bf7-b390c7c1b4fc}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (Child)"), + + //: The name of the DeviceClass ({296f1fd4-e893-46b2-8a42-50d1bceb8730}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (Display Pin)"), + + //: The name of the DeviceClass ({515ffdf1-55e5-498d-9abc-4e2fe768f3a9}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (InputTypes)"), + + //: The name of the DeviceClass ({a71fbde9-9a38-4bf8-beab-c8aade2608ba}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (Parent)"), + + //: The name of the DeviceClass ({9e03144c-e436-4eea-82d9-ccb33ef778db}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Device (Push Button)"), + + //: The name of the plugin mockDevice ({727a4a9a-c187-446f-aadf-f1b2220607d1}) + QT_TRANSLATE_NOOP("mockDevice", "Mock Devices"), + + //: The name of the EventType ({45bf3752-0fc6-46b9-89fd-ffd878b5b22b}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Event 1"), + + //: The name of the EventType ({45bf3752-0fc6-46b9-89fd-ffd878b5b22b}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Event 1"), + + //: The name of the EventType ({863d5920-b1cf-4eb9-88bd-8f7b8583b1cf}) of DeviceClass mockDeviceAuto + QT_TRANSLATE_NOOP("mockDevice", "Mock Event 2"), + + //: The name of the EventType ({863d5920-b1cf-4eb9-88bd-8f7b8583b1cf}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "Mock Event 2"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {e5c0d14b-c9f1-4aca-a56e-85bfa6977150}) + QT_TRANSLATE_NOOP("mockDevice", "Password text"), + + //: The pairing info of deviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Please enter the secret which normaly will be displayed on the device. For the mockdevice the pin is 243681."), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {22add8c9-ee4f-43ad-8931-58e999313ac3}) + QT_TRANSLATE_NOOP("mockDevice", "Search text"), + + //: The name of the ActionType ({a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Bool"), + + //: The name of the ActionType ({455f4f68-3cb0-4e8a-a707-62e4a2a8035c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Color"), + + //: The name of the ActionType ({8e2eb91b-d60b-4461-9a50-d7b8ad263170}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Double"), + + //: The name of the ActionType ({00d3425e-1da6-4748-8906-4555ceefb136}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Double (min/max)"), + + //: The name of the ActionType ({857a8422-983c-47d6-a15f-d8450b3162f7}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Int"), + + //: The name of the ActionType ({86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Int (min/max)"), + + //: The name of the ActionType ({ef511043-bd1a-4a5f-984c-222b7da43f38}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable String"), + + //: The name of the ActionType ({209d7afc-6fe9-4fe9-939b-e472ea0ad639}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable String (selection)"), + + //: The name of the ActionType ({d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Time"), + + //: The name of the ActionType ({88b6746a-b009-4df6-8986-d7884ffd94b2}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Timestamp (Int)"), + + //: The name of the ActionType ({45d0069a-63ac-4265-8170-8152778608ee}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable Timestamp (UInt)"), + + //: The name of the ActionType ({563e9c4c-5198-400a-9f6c-358f4752af58}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable UInt"), + + //: The name of the ActionType ({79238998-eaab-4d71-b406-5d78f1749751}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Set Writable UInt (min/max)"), + + //: The name of the ActionType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Set allowed values"), + + //: The name of the ActionType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Set allowed values"), + + //: The name of the ActionType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockChild + QT_TRANSLATE_NOOP("mockDevice", "Set bool value"), + + //: The name of the ActionType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockParent + QT_TRANSLATE_NOOP("mockDevice", "Set bool value"), + + //: The name of the ActionType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Set bool value"), + + //: The name of the ActionType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Set bool value"), + + //: The name of the ActionType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Set color"), + + //: The name of the ActionType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Set color"), + + //: The name of the ActionType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Set double value"), + + //: The name of the ActionType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Set double value"), + + //: The name of the ActionType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Set percentage"), + + //: The name of the ActionType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Set percentage"), + + //: The name of the ParamType (DeviceClass: mock, Type: settings, ID: {367f7ba4-5039-47be-abd8-59cc8eaf4b9a}) + QT_TRANSLATE_NOOP("mockDevice", "Setting 1"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: string, ID: {27f69ca9-a321-40ff-bfee-4b0272a671b4}) + QT_TRANSLATE_NOOP("mockDevice", "String"), + + //: The name of the StateType ({27f69ca9-a321-40ff-bfee-4b0272a671b4}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "String"), + + //: The name of the EventType ({27f69ca9-a321-40ff-bfee-4b0272a671b4}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "String changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {716f0994-bc01-42b0-b64d-59236f7320d2}) + QT_TRANSLATE_NOOP("mockDevice", "Text area"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {e6acf0c7-4b8e-4296-ac62-855d20deb816}) + QT_TRANSLATE_NOOP("mockDevice", "Text line"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: time, ID: {8250c71e-59bc-41ab-b576-99fcfc34e8d1}) + QT_TRANSLATE_NOOP("mockDevice", "Time"), + + //: The name of the StateType ({8250c71e-59bc-41ab-b576-99fcfc34e8d1}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Time"), + + //: The name of the EventType ({8250c71e-59bc-41ab-b576-99fcfc34e8d1}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Time changed"), + + //: The name of the ActionType ({54646e7c-bc54-4895-81a2-590d72d120f9}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "Timeout action"), + + //: The name of the ActionType ({54646e7c-bc54-4895-81a2-590d72d120f9}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Timeout action"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: timestampInt, ID: {2c91b5ef-c2d1-4367-bc65-5a13abf69641}) + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (Int)"), + + //: The name of the StateType ({2c91b5ef-c2d1-4367-bc65-5a13abf69641}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (Int)"), + + //: The name of the EventType ({2c91b5ef-c2d1-4367-bc65-5a13abf69641}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (Int) changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: timestampUInt, ID: {6c9a96e8-0d48-4f42-8967-848358fd7f79}) + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (UInt)"), + + //: The name of the StateType ({6c9a96e8-0d48-4f42-8967-848358fd7f79}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (UInt)"), + + //: The name of the EventType ({6c9a96e8-0d48-4f42-8967-848358fd7f79}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Timestamp (UInt) changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: uint, ID: {19e74fcc-bfd5-491f-8eb6-af128e8f1162}) + QT_TRANSLATE_NOOP("mockDevice", "UInt"), + + //: The name of the StateType ({19e74fcc-bfd5-491f-8eb6-af128e8f1162}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "UInt"), + + //: The name of the EventType ({19e74fcc-bfd5-491f-8eb6-af128e8f1162}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "UInt changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, Type: device, ID: {fa67229f-fcef-496f-b671-59a4b48f3ab5}) + QT_TRANSLATE_NOOP("mockDevice", "URL"), + + //: The pairing info of deviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "Wait 3 second before you continue, the push button will be pressed automatically."), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableBool, ID: {a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Bool"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableBool, ID: {a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Bool"), + + //: The name of the StateType ({a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Bool"), + + //: The name of the EventType ({a7c11774-f31f-4d64-99d1-e0ae5fb35a5c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Bool changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableColor, ID: {455f4f68-3cb0-4e8a-a707-62e4a2a8035c}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Color"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableColor, ID: {455f4f68-3cb0-4e8a-a707-62e4a2a8035c}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Color"), + + //: The name of the StateType ({455f4f68-3cb0-4e8a-a707-62e4a2a8035c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Color"), + + //: The name of the EventType ({455f4f68-3cb0-4e8a-a707-62e4a2a8035c}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Color changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableDouble, ID: {8e2eb91b-d60b-4461-9a50-d7b8ad263170}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Double"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableDouble, ID: {8e2eb91b-d60b-4461-9a50-d7b8ad263170}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Double"), + + //: The name of the StateType ({8e2eb91b-d60b-4461-9a50-d7b8ad263170}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Double"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableDoubleMinMax, ID: {00d3425e-1da6-4748-8906-4555ceefb136}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Double (min/max)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableDoubleMinMax, ID: {00d3425e-1da6-4748-8906-4555ceefb136}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Double (min/max)"), + + //: The name of the StateType ({00d3425e-1da6-4748-8906-4555ceefb136}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Double (min/max)"), + + //: The name of the EventType ({00d3425e-1da6-4748-8906-4555ceefb136}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Double (min/max) changed"), + + //: The name of the EventType ({8e2eb91b-d60b-4461-9a50-d7b8ad263170}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Double changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableInt, ID: {857a8422-983c-47d6-a15f-d8450b3162f7}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Int"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableInt, ID: {857a8422-983c-47d6-a15f-d8450b3162f7}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Int"), + + //: The name of the StateType ({857a8422-983c-47d6-a15f-d8450b3162f7}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Int"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableIntMinMax, ID: {86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Int (min/max)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableIntMinMax, ID: {86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Int (min/max)"), + + //: The name of the StateType ({86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Int (min/max)"), + + //: The name of the EventType ({86a107bc-510a-4d38-bfeb-0a9c2b6d8d87}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Int (min/max) changed"), + + //: The name of the EventType ({857a8422-983c-47d6-a15f-d8450b3162f7}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Int changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableString, ID: {ef511043-bd1a-4a5f-984c-222b7da43f38}) + QT_TRANSLATE_NOOP("mockDevice", "Writable String"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableString, ID: {ef511043-bd1a-4a5f-984c-222b7da43f38}) + QT_TRANSLATE_NOOP("mockDevice", "Writable String"), + + //: The name of the StateType ({ef511043-bd1a-4a5f-984c-222b7da43f38}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable String"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableStringSelection, ID: {209d7afc-6fe9-4fe9-939b-e472ea0ad639}) + QT_TRANSLATE_NOOP("mockDevice", "Writable String (selection)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableStringSelection, ID: {209d7afc-6fe9-4fe9-939b-e472ea0ad639}) + QT_TRANSLATE_NOOP("mockDevice", "Writable String (selection)"), + + //: The name of the StateType ({209d7afc-6fe9-4fe9-939b-e472ea0ad639}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable String (selection)"), + + //: The name of the EventType ({209d7afc-6fe9-4fe9-939b-e472ea0ad639}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable String (selection) changed"), + + //: The name of the EventType ({ef511043-bd1a-4a5f-984c-222b7da43f38}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable String changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableTime, ID: {d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Time"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableTime, ID: {d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Time"), + + //: The name of the StateType ({d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Time"), + + //: The name of the EventType ({d64c8b3f-ca7d-47f6-b271-867ffd80a4d4}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Time changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableTimestampInt, ID: {88b6746a-b009-4df6-8986-d7884ffd94b2}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (Int)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableTimestampInt, ID: {88b6746a-b009-4df6-8986-d7884ffd94b2}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (Int)"), + + //: The name of the StateType ({88b6746a-b009-4df6-8986-d7884ffd94b2}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (Int)"), + + //: The name of the EventType ({88b6746a-b009-4df6-8986-d7884ffd94b2}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (Int) changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableTimestampUInt, ID: {45d0069a-63ac-4265-8170-8152778608ee}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (UInt)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableTimestampUInt, ID: {45d0069a-63ac-4265-8170-8152778608ee}) + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (UInt)"), + + //: The name of the StateType ({45d0069a-63ac-4265-8170-8152778608ee}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (UInt)"), + + //: The name of the EventType ({45d0069a-63ac-4265-8170-8152778608ee}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable Timestamp (UInt) changed"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableUInt, ID: {563e9c4c-5198-400a-9f6c-358f4752af58}) + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableUInt, ID: {563e9c4c-5198-400a-9f6c-358f4752af58}) + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt"), + + //: The name of the StateType ({563e9c4c-5198-400a-9f6c-358f4752af58}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt"), + + //: The name of the ParamType (DeviceClass: mockInputType, ActionType: writableUIntMinMax, ID: {79238998-eaab-4d71-b406-5d78f1749751}) + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt (min/max)"), + + //: The name of the ParamType (DeviceClass: mockInputType, EventType: writableUIntMinMax, ID: {79238998-eaab-4d71-b406-5d78f1749751}) + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt (min/max)"), + + //: The name of the StateType ({79238998-eaab-4d71-b406-5d78f1749751}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt (min/max)"), + + //: The name of the EventType ({79238998-eaab-4d71-b406-5d78f1749751}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt (min/max) changed"), + + //: The name of the EventType ({563e9c4c-5198-400a-9f6c-358f4752af58}) of DeviceClass mockInputType + QT_TRANSLATE_NOOP("mockDevice", "Writable UInt changed"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, ActionType: allowedValues, ID: {05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, EventType: allowedValues, ID: {05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the StateType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the ParamType (DeviceClass: mockPushButton, ActionType: allowedValues, ID: {05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the ParamType (DeviceClass: mockPushButton, EventType: allowedValues, ID: {05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the StateType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "allowed values"), + + //: The name of the EventType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "allowed values changed"), + + //: The name of the EventType ({05f63f9c-f61e-4dcf-ad55-3f13fde2765b}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "allowed values changed"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, Type: device, ID: {f2977061-4dd0-4ef5-85aa-3b7134743be3}) + QT_TRANSLATE_NOOP("mockDevice", "async"), + + //: The name of the ParamType (DeviceClass: mock, Type: device, ID: {f2977061-4dd0-4ef5-85aa-3b7134743be3}) + QT_TRANSLATE_NOOP("mockDevice", "async"), + + //: The name of the ParamType (DeviceClass: mock, EventType: batteryLevel, ID: {6c8ab9a6-0164-4795-b829-f4394fe4edc4}) + QT_TRANSLATE_NOOP("mockDevice", "battery level"), + + //: The name of the EventType ({6c8ab9a6-0164-4795-b829-f4394fe4edc4}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "battery level"), + + //: The name of the StateType ({6c8ab9a6-0164-4795-b829-f4394fe4edc4}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "battery level"), + + //: The name of the ParamType (DeviceClass: mock, EventType: batteryCritical, ID: {580bc611-1a55-41f3-996f-8d3ccf543db3}) + QT_TRANSLATE_NOOP("mockDevice", "battery level critical"), + + //: The name of the EventType ({580bc611-1a55-41f3-996f-8d3ccf543db3}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "battery level critical"), + + //: The name of the StateType ({580bc611-1a55-41f3-996f-8d3ccf543db3}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "battery level critical"), + + //: The name of the ParamType (DeviceClass: mockChild, ActionType: boolValue, ID: {d24ede5f-4064-4898-bb84-cfb533b1fbc0}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockChild, EventType: boolValue, ID: {d24ede5f-4064-4898-bb84-cfb533b1fbc0}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the StateType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockChild + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockParent, ActionType: boolValue, ID: {d24ede5f-4064-4898-bb84-cfb533b1fbc0}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockParent, EventType: boolValue, ID: {d24ede5f-4064-4898-bb84-cfb533b1fbc0}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the StateType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockParent + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, ActionType: bool, ID: {e680f7a4-b39e-46da-be41-fa3170fe3768}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, EventType: bool, ID: {e680f7a4-b39e-46da-be41-fa3170fe3768}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the StateType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockPushButton, ActionType: bool, ID: {e680f7a4-b39e-46da-be41-fa3170fe3768}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the ParamType (DeviceClass: mockPushButton, EventType: bool, ID: {e680f7a4-b39e-46da-be41-fa3170fe3768}) + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the StateType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "bool value"), + + //: The name of the EventType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockChild + QT_TRANSLATE_NOOP("mockDevice", "bool value changed"), + + //: The name of the EventType ({d24ede5f-4064-4898-bb84-cfb533b1fbc0}) of DeviceClass mockParent + QT_TRANSLATE_NOOP("mockDevice", "bool value changed"), + + //: The name of the EventType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "bool value changed"), + + //: The name of the EventType ({e680f7a4-b39e-46da-be41-fa3170fe3768}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "bool value changed"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, Type: device, ID: {ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4}) + QT_TRANSLATE_NOOP("mockDevice", "broken"), + + //: The name of the ParamType (DeviceClass: mock, Type: device, ID: {ae8f8901-f2c1-42a5-8111-6d2fc8e4c1e4}) + QT_TRANSLATE_NOOP("mockDevice", "broken"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, ActionType: color, ID: {20dc7c22-c50e-42db-837c-2bbced939f8e}) + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, EventType: color, ID: {20dc7c22-c50e-42db-837c-2bbced939f8e}) + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the StateType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the ParamType (DeviceClass: mockPushButton, ActionType: color, ID: {20dc7c22-c50e-42db-837c-2bbced939f8e}) + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the ParamType (DeviceClass: mockPushButton, EventType: color, ID: {20dc7c22-c50e-42db-837c-2bbced939f8e}) + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the StateType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "color"), + + //: The name of the EventType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "color changed"), + + //: The name of the EventType ({20dc7c22-c50e-42db-837c-2bbced939f8e}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "color changed"), + + //: The name of the ParamType (DeviceClass: mockDevice, Type: plugin, ID: {c75723b6-ea4f-4982-9751-6c5e39c88145}) + QT_TRANSLATE_NOOP("mockDevice", "configParamBool"), + + //: The name of the ParamType (DeviceClass: mockDevice, Type: plugin, ID: {e1f72121-a426-45e2-b475-8262b5cdf103}) + QT_TRANSLATE_NOOP("mockDevice", "configParamInt"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, ActionType: double, ID: {53cd7c55-49b7-441b-b970-9048f20f0e2c}) + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, EventType: double, ID: {53cd7c55-49b7-441b-b970-9048f20f0e2c}) + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the StateType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the ParamType (DeviceClass: mockPushButton, ActionType: double, ID: {53cd7c55-49b7-441b-b970-9048f20f0e2c}) + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the ParamType (DeviceClass: mockPushButton, EventType: double, ID: {53cd7c55-49b7-441b-b970-9048f20f0e2c}) + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the StateType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "double value"), + + //: The name of the EventType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "double value changed"), + + //: The name of the EventType ({53cd7c55-49b7-441b-b970-9048f20f0e2c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "double value changed"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, Type: device, ID: {d4f06047-125e-4479-9810-b54c189917f5}) + QT_TRANSLATE_NOOP("mockDevice", "http port"), + + //: The name of the ParamType (DeviceClass: mock, Type: device, ID: {d4f06047-125e-4479-9810-b54c189917f5}) + QT_TRANSLATE_NOOP("mockDevice", "http port"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, ActionType: withParams, ID: {a2d3a256-a551-4712-a65b-ecd5a436a1cb}) + QT_TRANSLATE_NOOP("mockDevice", "mockActionParam1"), + + //: The name of the ParamType (DeviceClass: mock, ActionType: withParams, ID: {a2d3a256-a551-4712-a65b-ecd5a436a1cb}) + QT_TRANSLATE_NOOP("mockDevice", "mockActionParam1"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, ActionType: withParams, ID: {304a4899-18be-4e3b-94f4-d03be52f3233}) + QT_TRANSLATE_NOOP("mockDevice", "mockActionParam2"), + + //: The name of the ParamType (DeviceClass: mock, ActionType: withParams, ID: {304a4899-18be-4e3b-94f4-d03be52f3233}) + QT_TRANSLATE_NOOP("mockDevice", "mockActionParam2"), + + //: The name of the ParamType (DeviceClass: mockDeviceAuto, EventType: event2, ID: {0550e16d-60b9-4ba5-83f4-4d3cee656121}) + QT_TRANSLATE_NOOP("mockDevice", "mockParamInt"), + + //: The name of the ParamType (DeviceClass: mock, EventType: mockEvent2, ID: {0550e16d-60b9-4ba5-83f4-4d3cee656121}) + QT_TRANSLATE_NOOP("mockDevice", "mockParamInt"), + + //: The name of the vendor ({2062d64d-3232-433c-88bc-0d33c0ba2ba6}) + QT_TRANSLATE_NOOP("mockDevice", "nymea"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, ActionType: percentage, ID: {72981c04-267a-4ba0-a59e-9921d2f3af9c}) + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, EventType: percentage, ID: {72981c04-267a-4ba0-a59e-9921d2f3af9c}) + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the StateType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the ParamType (DeviceClass: mockPushButton, ActionType: percentage, ID: {72981c04-267a-4ba0-a59e-9921d2f3af9c}) + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the ParamType (DeviceClass: mockPushButton, EventType: percentage, ID: {72981c04-267a-4ba0-a59e-9921d2f3af9c}) + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the StateType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "percentage"), + + //: The name of the EventType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockDisplayPin + QT_TRANSLATE_NOOP("mockDevice", "percentage changed"), + + //: The name of the EventType ({72981c04-267a-4ba0-a59e-9921d2f3af9c}) of DeviceClass mockPushButton + QT_TRANSLATE_NOOP("mockDevice", "percentage changed"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, Type: device, ID: {da820e07-22dc-4173-9c07-2f49a4e265f9}) + QT_TRANSLATE_NOOP("mockDevice", "pin"), + + //: The name of the ParamType (DeviceClass: mock, ActionType: power, ID: {064aed0d-da4c-49d4-b236-60f97e98ff84}) + QT_TRANSLATE_NOOP("mockDevice", "powered"), + + //: The name of the ParamType (DeviceClass: mock, EventType: power, ID: {064aed0d-da4c-49d4-b236-60f97e98ff84}) + QT_TRANSLATE_NOOP("mockDevice", "powered"), + + //: The name of the StateType ({064aed0d-da4c-49d4-b236-60f97e98ff84}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "powered"), + + //: The name of the EventType ({064aed0d-da4c-49d4-b236-60f97e98ff84}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "powered changed"), + + //: The name of the ParamType (DeviceClass: mockDisplayPin, Type: discovery, ID: {d222adb4-2f9c-4c3f-8655-76400d0fb6ce}) + QT_TRANSLATE_NOOP("mockDevice", "resultCount"), + + //: The name of the ParamType (DeviceClass: mockPushButton, Type: discovery, ID: {d222adb4-2f9c-4c3f-8655-76400d0fb6ce}) + QT_TRANSLATE_NOOP("mockDevice", "resultCount"), + + //: The name of the ParamType (DeviceClass: mock, Type: discovery, ID: {d222adb4-2f9c-4c3f-8655-76400d0fb6ce}) + QT_TRANSLATE_NOOP("mockDevice", "resultCount"), + + //: The name of the ActionType ({064aed0d-da4c-49d4-b236-60f97e98ff84}) of DeviceClass mock + QT_TRANSLATE_NOOP("mockDevice", "set power") +}; + +#endif // PLUGININFO_H diff --git a/plugins/plugins.pri b/plugins/plugins.pri index 66d11c8c..c9aecef6 100644 --- a/plugins/plugins.pri +++ b/plugins/plugins.pri @@ -7,30 +7,18 @@ QT += network INCLUDEPATH += $$top_srcdir/libnymea LIBS += -L../../libnymea -lnymea -HEADERS += plugininfo.h +HEADERS += plugininfo.h extern-plugininfo.h + +# A target for manually updating the plugininfo file +# NOTE: In cross compiling environments we can't run the plugininfocompiler +# so we can't do this automatically at build time +plugininfo.commands = LD_LIBRARY_PATH=$$top_builddir/libnymea \ + $$top_builddir/tools/nymea-plugininfocompiler/nymea-plugininfocompiler \ + $$PWD/$${TARGET}/deviceplugin"$$TARGET".json \ + --output $$PWD/$${TARGET}/plugininfo.h \ + --extern $$PWD/$${TARGET}/extern-plugininfo.h +QMAKE_EXTRA_TARGETS += plugininfo -# Create plugininfo file -JSONFILE=$$PWD/$$TARGET/deviceplugin"$$TARGET".json -plugininfo.input = JSONFILE -plugininfo.output = plugininfo.h -plugininfo.CONFIG = no_link target_predeps -plugininfo.commands = $$top_srcdir/libnymea/devices/nymea-generateplugininfo \ - --filetype i \ - --jsonfile $$PWD/$$TARGET/deviceplugin"$$TARGET".json \ - --output plugininfo.h \ - --builddir $$OUT_PWD; -extern-plugininfo.input = JSONFILE -extern-plugininfo.output = extern-plugininfo.h -extern-plugininfo.CONFIG = no_link target_predeps -extern-plugininfo.commands = $$top_srcdir/libnymea/devices/nymea-generateplugininfo \ - --filetype e \ - --jsonfile $$PWD/$$TARGET/deviceplugin"$$TARGET".json \ - --output extern-plugininfo.h \ - --builddir $$OUT_PWD; -# Add it as a compiler, so it will be called before building like moc -QMAKE_EXTRA_COMPILERS += plugininfo extern-plugininfo -# But also add it as a target so we can add it separately without building. E.g. for updating translations. -QMAKE_EXTRA_TARGETS += plugininfo extern-plugininfo # Install plugin target.path = $$[QT_INSTALL_LIBS]/nymea/plugins/ diff --git a/tools/nymea-plugininfocompiler/main.cpp b/tools/nymea-plugininfocompiler/main.cpp new file mode 100644 index 00000000..a7df0c0e --- /dev/null +++ b/tools/nymea-plugininfocompiler/main.cpp @@ -0,0 +1,54 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * * + * Copyright (C) 2019 Michael Zanetti * + * * + * This file is part of nymea. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; If not, see * + * . * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include + +#include "plugininfocompiler.h" + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + + QCommandLineParser parser; + parser.setApplicationDescription("The nymea plugin info compiler. Compiles a plugininfo.json into a plugininfo.h/plugininfo-extern.h."); + parser.addHelpOption(); + parser.addOption({{"o", "output"}, "Write generated output header to .", "file", "-"}); + parser.addOption({{"e", "extern"}, "Write generated output header (extern definitions) to .", "file", "-"}); + parser.addPositionalArgument("input", "The input json file"); + + parser.process(a); + + if (parser.positionalArguments().count() != 1) { + qWarning() << qUtf8Printable(parser.helpText()); + return 1; + } + + PluginInfoCompiler pic; + + int ret = pic.compile(parser.positionalArguments().first(), parser.value("output"), parser.value("extern")); + + return ret; + +} diff --git a/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro b/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro new file mode 100644 index 00000000..d5ab2478 --- /dev/null +++ b/tools/nymea-plugininfocompiler/nymea-plugininfocompiler.pro @@ -0,0 +1,17 @@ +QT -= gui +CONFIG += c++11 console +CONFIG -= app_bundle + +include(../../nymea.pri) +INCLUDEPATH += $$top_srcdir/libnymea +LIBS += -L$$top_builddir/libnymea -lnymea + +SOURCES += \ + main.cpp \ + plugininfocompiler.cpp + +HEADERS += \ + plugininfocompiler.h + +target.path = $$[QT_INSTALL_PREFIX]/bin +INSTALLS += target diff --git a/tools/nymea-plugininfocompiler/plugininfocompiler.cpp b/tools/nymea-plugininfocompiler/plugininfocompiler.cpp new file mode 100644 index 00000000..f5890b5e --- /dev/null +++ b/tools/nymea-plugininfocompiler/plugininfocompiler.cpp @@ -0,0 +1,286 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * * + * Copyright (C) 2019 Michael Zanetti * + * * + * This file is part of nymea. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; If not, see * + * . * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "plugininfocompiler.h" + +#include +#include +#include +#include +#include + +PluginInfoCompiler::PluginInfoCompiler() +{ + +} + +int PluginInfoCompiler::compile(const QString &inputFile, const QString &outputFile, const QString outputFileExtern) +{ + // First, process the input json... + QFile jsonFile(inputFile); + if (!jsonFile.open(QFile::ReadOnly)) { + qWarning() << "Error opening input JSON file for reading. Aborting."; + return 1; + } + QJsonParseError error; + QJsonDocument jsonDoc = QJsonDocument::fromJson(jsonFile.readAll(), &error); + jsonFile.close(); + + if (error.error != QJsonParseError::NoError) { + qWarning() << "Error parsing input JSON. Aborting."; + return 1; + } + QJsonObject jsonObject = QJsonObject::fromVariantMap(jsonDoc.toVariant().toMap()); + + PluginMetadata metadata(jsonObject); + if (!metadata.isValid()) { + qWarning() << "Plugin JSON failed validation. Aborting."; + return 2; + } + + // OK. Json parsed fine. Let's open files for writing + + if (outputFile == "-") { + if (!m_outputFile.open(stdout, QFile::WriteOnly | QFile::Text)) { + qWarning() << "Error opening stdout for writing. Aborting."; + return 1; + } + } else { + m_outputFile.setFileName(outputFile); + if (!m_outputFile.open(QFile::WriteOnly | QFile::Text)) { + qWarning() << "Error opening output file for writing. Aborting."; + return 1; + } + } + + if (outputFileExtern == "-") { + if (!m_outputFileExtern.open(stdout, QFile::WriteOnly | QFile::Text)) { + qWarning() << "Error opening stdout for writing. Aborting."; + return 1; + } + } else { + m_outputFileExtern.setFileName(outputFileExtern); + if (!m_outputFileExtern.open(QFile::WriteOnly | QFile::Text)) { + qWarning() << "Error opening output file for writing. Aborting."; + return 1; + } + } + + // Files are open. Ready to write content. + + QString header; + header.append("/* This file is generated by the nymea build system. Any changes to this file will *\n"); + header.append(" * be lost. If you want to change this file, edit the plugin's json file. */\n"); + write(header); + writeExtern(header); + + write("#ifndef PLUGININFO_H"); + write("#define PLUGININFO_H"); + write(); + writeExtern("#ifndef EXTERNPLUGININFO_H"); + writeExtern("#define EXTERNPLUGININFO_H"); + writeExtern(); + + write("#include \"typeutils.h\""); + write(); + writeExtern("#include \"typeutils.h\""); + writeExtern(); + + write("#include "); + writeExtern("#include "); + write("#include "); + write(); + writeExtern(); + + // Include our API version in plugininfo.h so we can know against which library this plugin was built. + write(QString("extern \"C\" const QString libnymea_api_version = QString(\"%1\");").arg(LIBNYMEA_API_VERSION)); + write(); + + // Declare a logging category for this plugin + QString debugCategoryName = metadata.pluginName()[0].toUpper() + metadata.pluginName().right(metadata.pluginName().length() - 1); + QString debugCategoryDeclaration = QString("Q_DECLARE_LOGGING_CATEGORY(dc%1)").arg(debugCategoryName); + write(debugCategoryDeclaration); + write(QString("Q_LOGGING_CATEGORY(dc%1, \"%1\")").arg(debugCategoryName)); + write(); + writeExtern(debugCategoryDeclaration); + writeExtern(); + + // Write down all the IDs + writePlugin(metadata); + write(); + writeExtern(); + + // And the translations + write(QString("const QString translations[] {")); + for (auto i = m_translationStrings.begin(); i != m_translationStrings.end();) { + write(QString(" //: %1").arg(i.value())); + QString line = QString(" QT_TRANSLATE_NOOP(\"%1\", \"%2\")").arg(metadata.pluginName(), i.key()); + i++; + if (i != m_translationStrings.end()) { + line.append(",\n"); + } + write(line); + } + write("};"); + write(); + + write("#endif // PLUGININFO_H"); + writeExtern("#endif // EXTERNPLUGININFO_H"); + + m_outputFile.close(); + m_outputFileExtern.close(); + return 0; +} + +void PluginInfoCompiler::writePlugin(const PluginMetadata &metadata) +{ + write(QString("PluginId pluginId = PluginId(\"%1\");").arg(metadata.pluginId().toString())); + m_translationStrings.insert(metadata.pluginDisplayName(), QString("The name of the plugin %1 (%2)").arg(metadata.pluginName()).arg(metadata.pluginId().toString())); + writeExtern(QString("extern %1 %2;").arg("PluginId").arg("pluginId")); + + writeParams(metadata.pluginSettings(), metadata.pluginName()[0].toLower() + metadata.pluginName().right(metadata.pluginName().length() - 1), "", "plugin"); + + foreach (const Vendor &vendor, metadata.vendors()) { + writeVendor(vendor); + } + + foreach (const DeviceClass &deviceClass, metadata.deviceClasses()) { + writeDeviceClass(deviceClass); + } + +} + +void PluginInfoCompiler::writeParams(const ParamTypes ¶mTypes, const QString &deviceClassName, const QString &typeClass, const QString &typeName) +{ + foreach (const ParamType ¶mType, paramTypes) { + QString variableName = QString("%1ParamTypeId").arg(deviceClassName + typeName[0].toUpper() + typeName.right(typeName.length()-1) + typeClass + paramType.name()[0].toUpper() + paramType.name().right(paramType.name().length() -1 )); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for ParamTypeId " << paramType.id() << ". Skipping entry."; + continue; + } + m_variableNames.append(variableName); + + write(QString("ParamTypeId %1 = ParamTypeId(\"%2\");").arg(variableName).arg(paramType.id().toString())); + m_translationStrings.insert(paramType.displayName(), QString("The name of the ParamType (DeviceClass: %1, %2Type: %3, ID: %4)").arg(deviceClassName).arg(typeClass).arg(typeName).arg(paramType.id().toString())); + writeExtern(QString("extern ParamTypeId %1;").arg(variableName)); + } +} + +void PluginInfoCompiler::writeVendor(const Vendor &vendor) +{ + QString variableName = QString("%1VendorId").arg(vendor.name()); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for Vendor " << vendor.id() << ". Skipping entry."; + return; + } + m_variableNames.append(variableName); + + write(QString("VendorId %1 = VendorId(\"%2\");").arg(variableName).arg(vendor.id().toString())); + m_translationStrings.insert(vendor.displayName(), QString("The name of the vendor (%1)").arg(vendor.id().toString())); + writeExtern(QString("extern VendorId %1;").arg(variableName)); +} + +void PluginInfoCompiler::writeDeviceClass(const DeviceClass &deviceClass) +{ + QString variableName = QString("%1DeviceClassId").arg(deviceClass.name()); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for DeviceClass " << deviceClass.id() << ". Skipping entry."; + return; + } + m_variableNames.append(variableName); + + write(QString("DeviceClassId %1 = DeviceClassId(\"%2\");").arg(variableName).arg(deviceClass.id().toString())); + m_translationStrings.insert(deviceClass.displayName(), QString("The name of the DeviceClass (%1)").arg(deviceClass.id().toString())); + writeExtern(QString("extern DeviceClassId %1;").arg(variableName)); + + if (!deviceClass.pairingInfo().isEmpty()) { + m_translationStrings.insert(deviceClass.pairingInfo(), QString("The pairing info of deviceClass %1").arg(deviceClass.name())); + } + + writeParams(deviceClass.paramTypes(), deviceClass.name(), "", "device"); + writeParams(deviceClass.settingsTypes(), deviceClass.name(), "", "settings"); + writeParams(deviceClass.discoveryParamTypes(), deviceClass.name(), "", "discovery"); + + writeStateTypes(deviceClass.stateTypes(), deviceClass.name()); + writeEventTypes(deviceClass.eventTypes(), deviceClass.name()); + writeActionTypes(deviceClass.actionTypes(), deviceClass.name()); +} + +void PluginInfoCompiler::writeStateTypes(const StateTypes &stateTypes, const QString &deviceClassName) +{ + foreach (const StateType &stateType, stateTypes) { + QString variableName = QString("%1%2StateTypeId").arg(deviceClassName, stateType.name()[0].toUpper() + stateType.name().right(stateType.name().length() - 1)); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for StateType " << stateType.name() << " in DeviceClass " << deviceClassName << ". Skipping entry."; + return; + } + m_variableNames.append(variableName); + write(QString("StateTypeId %1 = StateTypeId(\"%2\");").arg(variableName).arg(stateType.id().toString())); + m_translationStrings.insert(stateType.displayName(), QString("The name of the StateType (%1) of DeviceClass %2").arg(stateType.id().toString()).arg(deviceClassName)); + writeExtern(QString("extern StateTypeId %1;").arg(variableName)); + } +} + +void PluginInfoCompiler::writeEventTypes(const EventTypes &eventTypes, const QString &deviceClassName) +{ + foreach (const EventType &eventType, eventTypes) { + QString variableName = QString("%1%2EventTypeId").arg(deviceClassName, eventType.name()[0].toUpper() + eventType.name().right(eventType.name().length() - 1)); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for EventType " << eventType.name() << " in DeviceClass " << deviceClassName << ". Skipping entry."; + return; + } + m_variableNames.append(variableName); + write(QString("EventTypeId %1 = EventTypeId(\"%2\");").arg(variableName).arg(eventType.id().toString())); + m_translationStrings.insert(eventType.displayName(), QString("The name of the EventType (%1) of DeviceClass %2").arg(eventType.id().toString()).arg(deviceClassName)); + writeExtern(QString("extern EventTypeId %1;").arg(variableName)); + + writeParams(eventType.paramTypes(), deviceClassName, "Event", eventType.name()); + } +} + +void PluginInfoCompiler::writeActionTypes(const ActionTypes &actionTypes, const QString &deviceClassName) +{ + foreach (const ActionType &actionType, actionTypes) { + QString variableName = QString("%1%2ActionTypeId").arg(deviceClassName, actionType.name()[0].toUpper() + actionType.name().right(actionType.name().length() - 1)); + if (m_variableNames.contains(variableName)) { + qWarning().nospace() << "Error: Duplicate name " << variableName << " for ActionType " << actionType.name() << " in DeviceClass " << deviceClassName << ". Skipping entry."; + return; + } + m_variableNames.append(variableName); + write(QString("ActionTypeId %1 = ActionTypeId(\"%2\");").arg(variableName).arg(actionType.id().toString())); + m_translationStrings.insert(actionType.displayName(), QString("The name of the ActionType (%1) of DeviceClass %2").arg(actionType.id().toString()).arg(deviceClassName)); + writeExtern(QString("extern ActionTypeId %1;").arg(variableName)); + + writeParams(actionType.paramTypes(), deviceClassName, "Action", actionType.name()); + } + +} + +void PluginInfoCompiler::write(const QString &line) +{ + m_outputFile.write(QString("%1\n").arg(line).toUtf8()); +} + +void PluginInfoCompiler::writeExtern(const QString &line) +{ + m_outputFileExtern.write(QString("%1\n").arg(line).toUtf8()); +} diff --git a/tools/nymea-plugininfocompiler/plugininfocompiler.h b/tools/nymea-plugininfocompiler/plugininfocompiler.h new file mode 100644 index 00000000..aea74c25 --- /dev/null +++ b/tools/nymea-plugininfocompiler/plugininfocompiler.h @@ -0,0 +1,60 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * * + * Copyright (C) 2019 Michael Zanetti * + * * + * This file is part of nymea. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; If not, see * + * . * + * * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef PLUGININFOCOMPILER_H +#define PLUGININFOCOMPILER_H + +#include +#include + +#include "types/paramtype.h" +#include "devices/pluginmetadata.h" + +class PluginInfoCompiler +{ +public: + PluginInfoCompiler(); + + int compile(const QString &inputFile, const QString &outputFile, const QString outputFileExtern); + + +private: + void writePlugin(const PluginMetadata &metadata); + void writeParams(const ParamTypes ¶mTypes, const QString &deviceClassName, const QString &typeClass, const QString &typeName); + void writeVendor(const Vendor &vendor); + void writeDeviceClass(const DeviceClass &deviceClass); + void writeStateTypes(const StateTypes &stateTypes, const QString &deviceClassName); + void writeEventTypes(const EventTypes &eventTypes, const QString &deviceClassName); + void writeActionTypes(const ActionTypes &actionTypes, const QString &deviceClassName); + + void write(const QString &line = QString()); + void writeExtern(const QString &line = QString()); + + QMultiMap m_translationStrings; + + QStringList m_variableNames; + + QFile m_outputFile; + QFile m_outputFileExtern; +}; + +#endif // PLUGININFOCOMPILER_H diff --git a/tools/tools.pro b/tools/tools.pro new file mode 100644 index 00000000..f633ede5 --- /dev/null +++ b/tools/tools.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs + +SUBDIRS = nymea-plugininfocompiler