Add host address state for webinterface reference
This commit is contained in:
parent
99a1985958
commit
2a508e76b2
@ -163,9 +163,10 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info)
|
|||||||
if (!keba)
|
if (!keba)
|
||||||
return;
|
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) {
|
if (reachable) {
|
||||||
// Update address and refresh
|
// Update address and refresh
|
||||||
|
thing->setStateValue("hostAddress", monitor->networkDeviceInfo().address().toString());
|
||||||
keba->setAddress(monitor->networkDeviceInfo().address());
|
keba->setAddress(monitor->networkDeviceInfo().address());
|
||||||
refresh(thing, keba);
|
refresh(thing, keba);
|
||||||
}
|
}
|
||||||
@ -214,7 +215,6 @@ void IntegrationPluginKeba::postSetupThing(Thing *thing)
|
|||||||
}
|
}
|
||||||
|
|
||||||
refresh(thing, keba);
|
refresh(thing, keba);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -424,6 +424,7 @@ void IntegrationPluginKeba::setupKeba(ThingSetupInfo *info, const QHostAddress &
|
|||||||
qCDebug(dcKeba()) << "Setup finsihed successfully for" << thing << thing->params();
|
qCDebug(dcKeba()) << "Setup finsihed successfully for" << thing << thing->params();
|
||||||
|
|
||||||
thing->setStateValue("connected", true);
|
thing->setStateValue("connected", true);
|
||||||
|
thing->setStateValue("hostAddress", address.toString());
|
||||||
thing->setStateValue("firmware", report.firmware);
|
thing->setStateValue("firmware", report.firmware);
|
||||||
thing->setStateValue("uptime", report.seconds / 60);
|
thing->setStateValue("uptime", report.seconds / 60);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -335,6 +335,14 @@
|
|||||||
"displayNameEvent": "Firmware changed",
|
"displayNameEvent": "Firmware changed",
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"defaultValue": ""
|
"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": [
|
"actionTypes": [
|
||||||
@ -580,6 +588,14 @@
|
|||||||
"displayNameEvent": "Firmware changed",
|
"displayNameEvent": "Firmware changed",
|
||||||
"type": "QString",
|
"type": "QString",
|
||||||
"defaultValue": ""
|
"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": [
|
"actionTypes": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user