fix androidservice
This commit is contained in:
parent
f82fc9056d
commit
0c205e3edc
@ -120,7 +120,7 @@ void DeviceControlApplication::handleNdefMessage(QNdefMessage message, QNearFiel
|
|||||||
connectToNymea(nymeaId);
|
connectToNymea(nymeaId);
|
||||||
m_qmlEngine->rootContext()->setContextProperty("controlledThingId", thingId);
|
m_qmlEngine->rootContext()->setContextProperty("controlledThingId", thingId);
|
||||||
|
|
||||||
connect(m_engine->thingManager(), &DeviceManager::fetchingDataChanged, [this](){
|
connect(m_engine->thingManager(), &ThingManager::fetchingDataChanged, [this](){
|
||||||
if (m_engine->jsonRpcClient()->connected() && !m_engine->thingManager()->fetchingData()) {
|
if (m_engine->jsonRpcClient()->connected() && !m_engine->thingManager()->fetchingData()) {
|
||||||
qDebug() << "Ready to process commands";
|
qDebug() << "Ready to process commands";
|
||||||
runNfcAction();
|
runNfcAction();
|
||||||
@ -160,7 +160,7 @@ void DeviceControlApplication::runNfcAction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QUuid thingId = QUuid(QUrlQuery(url).queryItemValue("t"));
|
QUuid thingId = QUuid(QUrlQuery(url).queryItemValue("t"));
|
||||||
Device *thing = m_engine->thingManager()->things()->getThing(thingId);
|
Thing *thing = m_engine->thingManager()->things()->getThing(thingId);
|
||||||
if (!thing) {
|
if (!thing) {
|
||||||
qDebug() << "Thing" << thingId.toString() << "from" << url.toString() << "doesn't exist on nymea host" << nymeaId.toString();
|
qDebug() << "Thing" << thingId.toString() << "from" << url.toString() << "doesn't exist on nymea host" << nymeaId.toString();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -54,7 +54,7 @@ bool AndroidBinder::onTransact(int code, const QAndroidParcel &data, const QAndr
|
|||||||
}
|
}
|
||||||
QVariantList thingsList;
|
QVariantList thingsList;
|
||||||
for (int i = 0; i < engine->thingManager()->things()->rowCount(); i++) {
|
for (int i = 0; i < engine->thingManager()->things()->rowCount(); i++) {
|
||||||
Device *thing = engine->thingManager()->things()->get(i);
|
Thing *thing = engine->thingManager()->things()->get(i);
|
||||||
QVariantMap thingMap;
|
QVariantMap thingMap;
|
||||||
thingMap.insert("id", thing->id());
|
thingMap.insert("id", thing->id());
|
||||||
thingMap.insert("name", thing->name());
|
thingMap.insert("name", thing->name());
|
||||||
|
|||||||
@ -42,7 +42,7 @@ NymeaAppService::NymeaAppService(int argc, char **argv):
|
|||||||
m_engines.insert(host->uuid(), engine);
|
m_engines.insert(host->uuid(), engine);
|
||||||
|
|
||||||
|
|
||||||
QObject::connect(engine->thingManager(), &DeviceManager::thingStateChanged, [=](const QUuid &thingId, const QUuid &stateTypeId, const QVariant &value){
|
QObject::connect(engine->thingManager(), &ThingManager::thingStateChanged, [=](const QUuid &thingId, const QUuid &stateTypeId, const QVariant &value){
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
params.insert("nymeaId", engine->jsonRpcClient()->currentHost()->uuid());
|
params.insert("nymeaId", engine->jsonRpcClient()->currentHost()->uuid());
|
||||||
params.insert("thingId", thingId);
|
params.insert("thingId", thingId);
|
||||||
@ -51,7 +51,7 @@ NymeaAppService::NymeaAppService(int argc, char **argv):
|
|||||||
sendNotification("ThingStateChanged", params);
|
sendNotification("ThingStateChanged", params);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(engine->thingManager(), &DeviceManager::fetchingDataChanged, [=]() {
|
connect(engine->thingManager(), &ThingManager::fetchingDataChanged, [=]() {
|
||||||
qDebug() << "Fetching data changed";
|
qDebug() << "Fetching data changed";
|
||||||
QVariantMap params;
|
QVariantMap params;
|
||||||
params.insert("nymeaId", engine->jsonRpcClient()->currentHost()->uuid());
|
params.insert("nymeaId", engine->jsonRpcClient()->currentHost()->uuid());
|
||||||
|
|||||||
Reference in New Issue
Block a user