Allow [u]ints to be used with analog IO connections
This commit is contained in:
parent
1acd8ca808
commit
d1e4aaaaa2
@ -440,8 +440,8 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
|
|||||||
}
|
}
|
||||||
ioType = Types::IOTypeDigitalOutput;
|
ioType = Types::IOTypeDigitalOutput;
|
||||||
} else if (ioTypeString == "analogInput") {
|
} else if (ioTypeString == "analogInput") {
|
||||||
if (stateType.type() != QVariant::Double) {
|
if (stateType.type() != QVariant::Double && stateType.type() != QVariant::Int && stateType.type() != QVariant::UInt) {
|
||||||
m_validationErrors.append("Thing class \"" + thingClass.name() + "\" state type \"" + stateTypeName + "\" is marked as analog input but type is not \"double\"");
|
m_validationErrors.append("Thing class \"" + thingClass.name() + "\" state type \"" + stateTypeName + "\" is marked as analog input but type is not \"double\", \"int\" or \"uint\"");
|
||||||
hasError = true;
|
hasError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -452,8 +452,8 @@ void PluginMetadata::parse(const QJsonObject &jsonObject)
|
|||||||
}
|
}
|
||||||
ioType = Types::IOTypeAnalogInput;
|
ioType = Types::IOTypeAnalogInput;
|
||||||
} else if (ioTypeString == "analogOutput") {
|
} else if (ioTypeString == "analogOutput") {
|
||||||
if (stateType.type() != QVariant::Double) {
|
if (stateType.type() != QVariant::Double && stateType.type() != QVariant::Int && stateType.type() != QVariant::UInt) {
|
||||||
m_validationErrors.append("Thing class \"" + thingClass.name() + "\" state type \"" + stateTypeName + "\" is marked as analog output but type is not \"double\"");
|
m_validationErrors.append("Thing class \"" + thingClass.name() + "\" state type \"" + stateTypeName + "\" is marked as analog output but type is not \"double\", \"int\" or \"uint\"");
|
||||||
hasError = true;
|
hasError = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user