added input types in plugin json files

This commit is contained in:
Simon Stürz 2015-02-25 15:53:45 +01:00 committed by Michael Zanetti
parent a336077521
commit f331fe1591
16 changed files with 108 additions and 50 deletions

View File

@ -14,11 +14,13 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "command",
"type": "QString"
"type": "QString",
"inputType": "Url"
}
],
"stateTypes": [
@ -51,11 +53,13 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "script",
"type": "QString"
"type": "QString",
"inputType": "Url"
}
],
"stateTypes": [

View File

@ -14,7 +14,8 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"eventTypes": [
@ -47,7 +48,8 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"actionTypes": [

View File

@ -15,13 +15,15 @@
{
"name": "continent",
"type": "QString",
"inputType": "TextLine",
"allowedValues": ["Africa", "America", "Antarctica", "Asia", "Atlantic", "Australia", "Europe", "Indian", "Pacific"]
}
],
"paramTypes": [
{
"name": "timezone",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"stateTypes": [

View File

@ -14,7 +14,8 @@
"paramTypes": [
{
"name": "host address",
"type": "QString"
"type": "QString",
"inputType": "IPv4Address"
},
{
"name": "port",
@ -22,7 +23,8 @@
},
{
"name": "serial number",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "firmware version",

View File

@ -14,7 +14,8 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"stateTypes": [
@ -42,7 +43,8 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"actionTypes": [
@ -68,7 +70,8 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"actionTypes": [

View File

@ -15,6 +15,7 @@
{
"name": "familyCode",
"type": "QString",
"inputType": "TextLine",
"allowedValues": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"]
}
],

View File

@ -15,6 +15,7 @@
{
"name": "ID",
"type": "QString",
"inputType": "TextLine",
"allowedValues": ["0008", "0115", "0014"]
}
],

View File

@ -14,19 +14,23 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "uuid",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "model",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "host address",
"type": "QString"
"type": "QString",
"inputType": "IPv4Address"
},
{
"name": "port",
@ -34,15 +38,18 @@
},
{
"name": "location",
"type": "QString"
"type": "QString",
"inputType": "Url"
},
{
"name": "manufacturer",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "key",
"type": "QString"
"type": "QString",
"inputType": "Password"
}
],
"stateTypes": [

View File

@ -13,7 +13,8 @@
"paramTypes": [
{
"name": "remoteName",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"eventTypes": [

View File

@ -14,23 +14,28 @@
"paramTypes": [
{
"name": "sender mail",
"type": "QString"
"type": "QString",
"inputType": "Mail"
},
{
"name": "user",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "password",
"type": "QString"
"type": "QString",
"inputType": "Password"
},
{
"name": "recipient",
"type": "QString"
"type": "QString",
"inputType": "Mail"
},
{
"name": "SMTP server",
"type": "QString"
"type": "QString",
"inputType": "Url"
},
{
"name": "port",
@ -56,11 +61,13 @@
"paramTypes": [
{
"name": "subject",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "body",
"type": "QString"
"type": "QString",
"inputType": "TextArea"
}
]
}
@ -80,15 +87,18 @@
"paramTypes": [
{
"name": "user",
"type": "QString"
"type": "QString",
"inputType": "Mail"
},
{
"name": "password",
"type": "QString"
"type": "QString",
"inputType": "Password"
},
{
"name": "recipient",
"type": "QString"
"type": "QString",
"inputType": "Mail"
}
],
"actionTypes": [
@ -99,11 +109,13 @@
"paramTypes": [
{
"name": "subject",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "body",
"type": "QString"
"type": "QString",
"inputType": "TextArea"
}
]
}
@ -123,15 +135,18 @@
"paramTypes": [
{
"name": "user",
"type": "QString"
"type": "QString",
"inputType": "Mail"
},
{
"name": "password",
"type": "QString"
"type": "QString",
"inputType": "Password"
},
{
"name": "recipient",
"type": "QString"
"type": "QString",
"inputType": "Mail"
}
],
"actionTypes": [
@ -141,11 +156,13 @@
"paramTypes": [
{
"name": "subject",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "body",
"type": "QString"
"type": "QString",
"inputType": "TextArea"
}
]
}

View File

@ -14,21 +14,25 @@
"discoveryParamTypes": [
{
"name": "location",
"type": "QString"
"type": "QString",
"inputType": "Search"
}
],
"paramTypes": [
{
"name": "location",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "country",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "id",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"actionTypes": [

View File

@ -16,11 +16,13 @@
"paramTypes": [
{
"name": "ip",
"type" : "QString"
"type" : "QString",
"inputType": "IPv4Address"
},
{
"name": "username",
"type" : "QString"
"type" : "QString",
"inputType": "TextLine"
},
{
"name": "lightId",

View File

@ -13,11 +13,13 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "MAC",
"type": "QString"
"name": "Mac",
"type": "QString",
"inputType": "MacAddress"
}
],
"actionTypes": [

View File

@ -14,11 +14,13 @@
"paramTypes": [
{
"name": "name",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
},
{
"name": "host address",
"type": "QString"
"type": "QString",
"inputType": "IPv4Address"
},
{
"name": "port",
@ -26,7 +28,8 @@
},
{
"name": "serial number",
"type": "QString"
"type": "QString",
"inputType": "TextLine"
}
],
"stateTypes": [

View File

@ -13,7 +13,8 @@
"paramTypes": [
{
"name": "MAC",
"type": "QString"
"type": "QString",
"inputType": "MacAddress"
}
],
"stateTypes": [

View File

@ -899,6 +899,12 @@ QPair<bool, QString> JsonTypes::validateVariant(const QVariant &templateVariant,
qDebug() << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingEventTypeRef());
return result;
}
} else if (refName == inputTypeRef()) {
QPair<bool, QString> result = validateEnum(s_inputType, variant);
if (!result.first) {
qDebug() << QString("value %1 not allowed in %2").arg(variant.toString()).arg(inputTypeRef());
return result;
}
} else {
Q_ASSERT_X(false, "JsonTypes", QString("Unhandled ref: %1").arg(refName).toLatin1().data());
return report(false, QString("Unhandled ref %1. Server implementation incomplete.").arg(refName));