Fix handling of IP address changes

master
Simon Stürz 2021-06-07 17:15:39 +02:00
parent 36a5aece0d
commit a61e6fd244
1 changed files with 6 additions and 0 deletions

View File

@ -291,6 +291,12 @@ void IntegrationPluginKeba::searchNetworkDevices()
if (existingThing->paramValue(wallboxThingIpAddressParamTypeId).toString() != networkDevice.address().toString()) {
qCDebug(dcKebaKeContact()) << "Keba Wallbox IP Address has changed, from" << existingThing->paramValue(wallboxThingIpAddressParamTypeId).toString() << "to" << networkDevice.address().toString();
existingThing->setParamValue(wallboxThingIpAddressParamTypeId, networkDevice.address().toString());
KeContact *keba = m_kebaDevices.value(existingThing->id());
if (keba) {
keba->setAddress(QHostAddress(networkDevice.address()));
} else {
qCWarning(dcKebaKeContact()) << "Could not update IP address, for" << existingThing;
}
} else {
qCDebug(dcKebaKeContact()) << "Keba Wallbox" << existingThing->name() << "IP address has not changed" << networkDevice.address().toString();
}