Merge PR #107: Mennekes: Discard unknown discovery results

master
jenkins 2023-02-01 12:18:25 +01:00
commit b4f5e1cca9
2 changed files with 11 additions and 0 deletions

View File

@ -83,6 +83,11 @@ void AmtronECUDiscovery::checkNetworkDevice(const NetworkDeviceInfo &networkDevi
cleanupConnection(connection);
return;
}
if (connection->firmwareVersion() == 0 || connection->model().isEmpty()) {
qCDebug(dcMennekes()) << "Firmware version or model invalid. Skipping" << networkDeviceInfo.address();
cleanupConnection(connection);
return;
}
Result result;
result.firmwareVersion = connection->firmwareVersion();
result.model = connection->model();

View File

@ -85,6 +85,12 @@ void AmtronHCC3Discovery::checkNetworkDevice(const NetworkDeviceInfo &networkDev
cleanupConnection(connection);
return;
}
if (connection->serialNumber() == 0 || connection->name().isEmpty()) {
qCDebug(dcMennekes()) << "Serial number or name invalid. Skipping" << networkDeviceInfo.address();
cleanupConnection(connection);
return;
}
AmtronDiscoveryResult result;
result.wallboxName = connection->name();
result.serialNumber = connection->serialNumber();