add 2 missing data type conversions
This commit is contained in:
parent
78e37f0d87
commit
1018083052
@ -56,7 +56,16 @@ QVariant PyObjectToQVariant(PyObject *pyObject)
|
||||
if (qstrcmp(pyObject->ob_type->tp_name, "double") == 0) {
|
||||
return QVariant(PyFloat_AsDouble(pyObject));
|
||||
}
|
||||
Q_ASSERT_X(false, "pyutils.h", "Unhandled data type in conversion from Param to PyParam!");
|
||||
|
||||
if (qstrcmp(pyObject->ob_type->tp_name, "float") == 0) {
|
||||
return QVariant(PyFloat_AsDouble(pyObject));
|
||||
}
|
||||
|
||||
if (qstrcmp(pyObject->ob_type->tp_name, "bool") == 0) {
|
||||
return QVariant(PyObject_IsTrue(pyObject));
|
||||
}
|
||||
|
||||
Q_ASSERT_X(false, "pyutils.h", "Unhandled data type in conversion PyObject to QVariant!");
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
@ -1966,7 +1966,6 @@ void ThingManagerImplementation::loadThingStates(Thing *thing)
|
||||
}
|
||||
value.convert(stateType.type());
|
||||
thing->setStateValue(stateType.id(), value);
|
||||
qWarning() << "**** loaded state" << stateType.name() << value;
|
||||
} else {
|
||||
thing->setStateValue(stateType.id(), stateType.defaultValue());
|
||||
}
|
||||
|
||||
@ -7,8 +7,7 @@ async def init():
|
||||
logger.log("Python mock plugin init")
|
||||
|
||||
while True:
|
||||
await asyncio.sleep(2);
|
||||
logger.log("Updating stuff")
|
||||
await asyncio.sleep(5);
|
||||
for thing in myThings():
|
||||
if thing.thingClassId == pyMockThingClassId:
|
||||
logger.log("Emitting event 1 for", thing.name, "eventTypeId", pyMockEvent1EventTypeId)
|
||||
|
||||
Reference in New Issue
Block a user