Add host address state for webinterface reference

master
Simon Stürz 2022-05-24 17:49:26 +02:00
parent 99a1985958
commit 2a508e76b2
2 changed files with 19 additions and 2 deletions

View File

@ -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);
});

View File

@ -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": [