Mennekes: Discard unknown discovery results
parent
4fb80af76e
commit
49b7e2a57e
|
|
@ -83,6 +83,11 @@ void AmtronECUDiscovery::checkNetworkDevice(const NetworkDeviceInfo &networkDevi
|
||||||
cleanupConnection(connection);
|
cleanupConnection(connection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (connection->firmwareVersion() == 0 || connection->model().isEmpty()) {
|
||||||
|
qCDebug(dcMennekes()) << "Firmware version or model invalid. Skipping" << networkDeviceInfo.address();
|
||||||
|
cleanupConnection(connection);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Result result;
|
Result result;
|
||||||
result.firmwareVersion = connection->firmwareVersion();
|
result.firmwareVersion = connection->firmwareVersion();
|
||||||
result.model = connection->model();
|
result.model = connection->model();
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,12 @@ void AmtronHCC3Discovery::checkNetworkDevice(const NetworkDeviceInfo &networkDev
|
||||||
cleanupConnection(connection);
|
cleanupConnection(connection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (connection->serialNumber() == 0 || connection->name().isEmpty()) {
|
||||||
|
qCDebug(dcMennekes()) << "Serial number or name invalid. Skipping" << networkDeviceInfo.address();
|
||||||
|
cleanupConnection(connection);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AmtronDiscoveryResult result;
|
AmtronDiscoveryResult result;
|
||||||
result.wallboxName = connection->name();
|
result.wallboxName = connection->name();
|
||||||
result.serialNumber = connection->serialNumber();
|
result.serialNumber = connection->serialNumber();
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,9 @@ void IntegrationPluginMennekes::discoverThings(ThingDiscoveryInfo *info)
|
||||||
name = "AMTRON Charge Control";
|
name = "AMTRON Charge Control";
|
||||||
} else if (result.model.startsWith("P")) {
|
} else if (result.model.startsWith("P")) {
|
||||||
name = "AMTRON Professional";
|
name = "AMTRON Professional";
|
||||||
|
} else {
|
||||||
|
qCWarning(dcMennekes()) << "Unknown Amtron model:" << result.model;
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
ThingDescriptor descriptor(amtronECUThingClassId, name, description);
|
ThingDescriptor descriptor(amtronECUThingClassId, name, description);
|
||||||
qCDebug(dcMennekes()) << "Discovered:" << descriptor.title() << descriptor.description();
|
qCDebug(dcMennekes()) << "Discovered:" << descriptor.title() << descriptor.description();
|
||||||
|
|
@ -98,6 +101,7 @@ void IntegrationPluginMennekes::discoverThings(ThingDiscoveryInfo *info)
|
||||||
descriptor.setThingId(existingThings.first()->id());
|
descriptor.setThingId(existingThings.first()->id());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ParamList params;
|
ParamList params;
|
||||||
params << Param(amtronHCC3ThingMacAddressParamTypeId, result.networkDeviceInfo.macAddress());
|
params << Param(amtronHCC3ThingMacAddressParamTypeId, result.networkDeviceInfo.macAddress());
|
||||||
// Note: if we discover also the port and modbusaddress, we must fill them in from the discovery here, for now everywhere the defaults...
|
// Note: if we discover also the port and modbusaddress, we must fill them in from the discovery here, for now everywhere the defaults...
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue