Add host address state for webinterface reference
parent
99a1985958
commit
2a508e76b2
|
|
@ -163,9 +163,10 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info)
|
|||
if (!keba)
|
||||
return;
|
||||
|
||||
qCDebug(dcKeba()) << "Network device monitor reachable changed for" << thing->name() << reachable;
|
||||
qCDebug(dcKeba()) << "Network device monitor for" << thing->name() << (reachable ? "is now reachable" : "is not reachable any more" );
|
||||
if (reachable) {
|
||||
// Update address and refresh
|
||||
thing->setStateValue("hostAddress", monitor->networkDeviceInfo().address().toString());
|
||||
keba->setAddress(monitor->networkDeviceInfo().address());
|
||||
refresh(thing, keba);
|
||||
}
|
||||
|
|
@ -214,7 +215,6 @@ void IntegrationPluginKeba::postSetupThing(Thing *thing)
|
|||
}
|
||||
|
||||
refresh(thing, keba);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -424,6 +424,7 @@ void IntegrationPluginKeba::setupKeba(ThingSetupInfo *info, const QHostAddress &
|
|||
qCDebug(dcKeba()) << "Setup finsihed successfully for" << thing << thing->params();
|
||||
|
||||
thing->setStateValue("connected", true);
|
||||
thing->setStateValue("hostAddress", address.toString());
|
||||
thing->setStateValue("firmware", report.firmware);
|
||||
thing->setStateValue("uptime", report.seconds / 60);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -335,6 +335,14 @@
|
|||
"displayNameEvent": "Firmware changed",
|
||||
"type": "QString",
|
||||
"defaultValue": ""
|
||||
},
|
||||
{
|
||||
"id": "11501a4b-8b83-4b92-be3c-a714d507f158",
|
||||
"name": "hostAddress",
|
||||
"displayName": "Host address",
|
||||
"displayNameEvent": "Host address changed",
|
||||
"type": "QString",
|
||||
"defaultValue": "http://127.0.0.1"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
|
|
@ -580,6 +588,14 @@
|
|||
"displayNameEvent": "Firmware changed",
|
||||
"type": "QString",
|
||||
"defaultValue": ""
|
||||
},
|
||||
{
|
||||
"id": "eef1d569-f383-4980-8cb8-06ccc5069b0b",
|
||||
"name": "hostAddress",
|
||||
"displayName": "Host address",
|
||||
"displayNameEvent": "Host address changed",
|
||||
"type": "QString",
|
||||
"defaultValue": "http://127.0.0.1"
|
||||
}
|
||||
],
|
||||
"actionTypes": [
|
||||
|
|
|
|||
Loading…
Reference in New Issue