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": [ "paramTypes": [
{ {
"name": "name", "name": "name",
"type": "QString" "type": "QString",
"inputType": "TextLine"
}, },
{ {
"name": "command", "name": "command",
"type": "QString" "type": "QString",
"inputType": "Url"
} }
], ],
"stateTypes": [ "stateTypes": [
@ -51,11 +53,13 @@
"paramTypes": [ "paramTypes": [
{ {
"name": "name", "name": "name",
"type": "QString" "type": "QString",
"inputType": "TextLine"
}, },
{ {
"name": "script", "name": "script",
"type": "QString" "type": "QString",
"inputType": "Url"
} }
], ],
"stateTypes": [ "stateTypes": [

View File

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

View File

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

View File

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

View File

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

View File

@ -15,6 +15,7 @@
{ {
"name": "familyCode", "name": "familyCode",
"type": "QString", "type": "QString",
"inputType": "TextLine",
"allowedValues": ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"] "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", "name": "ID",
"type": "QString", "type": "QString",
"inputType": "TextLine",
"allowedValues": ["0008", "0115", "0014"] "allowedValues": ["0008", "0115", "0014"]
} }
], ],

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,8 @@
"paramTypes": [ "paramTypes": [
{ {
"name": "MAC", "name": "MAC",
"type": "QString" "type": "QString",
"inputType": "MacAddress"
} }
], ],
"stateTypes": [ "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()); qDebug() << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingEventTypeRef());
return result; 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 { } else {
Q_ASSERT_X(false, "JsonTypes", QString("Unhandled ref: %1").arg(refName).toLatin1().data()); 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)); return report(false, QString("Unhandled ref %1. Server implementation incomplete.").arg(refName));