Mennekes: Reject wallboxes where the firmware is too old

master
Michael Zanetti 2022-12-20 23:35:39 +01:00
parent 015e25ee13
commit 9a8377f93a
2 changed files with 21 additions and 6 deletions

View File

@ -389,6 +389,16 @@ void IntegrationPluginMennekes::setupAmtronECUConnection(ThingSetupInfo *info)
}
qCDebug(dcMennekes()) << "Connection init finished successfully" << amtronECUConnection;
QString minimumVersion = "5.22";
if (!ensureAmtronECUVersion(amtronECUConnection, minimumVersion)) {
qCWarning(dcMennekes()) << "Firmware version too old:" << QByteArray::fromHex(QByteArray::number(amtronECUConnection->firmwareVersion(), 16)) << "Minimum required:" << minimumVersion;
hardwareManager()->networkDeviceDiscovery()->unregisterMonitor(monitor);
amtronECUConnection->deleteLater();
info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("The firmware version of this wallbox is too old. Please upgrade the firmware to at least version 5.22."));
return;
}
m_amtronECUConnections.insert(thing, amtronECUConnection);
info->finish(Thing::ThingErrorNoError);

View File

@ -9,23 +9,28 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationpluginmennekes.cpp" line="127"/>
<location filename="../integrationpluginmennekes.cpp" line="177"/>
<location filename="../integrationpluginmennekes.cpp" line="133"/>
<location filename="../integrationpluginmennekes.cpp" line="183"/>
<source>The MAC address is not known. Please reconfigure the thing.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationpluginmennekes.cpp" line="138"/>
<location filename="../integrationpluginmennekes.cpp" line="188"/>
<location filename="../integrationpluginmennekes.cpp" line="144"/>
<location filename="../integrationpluginmennekes.cpp" line="194"/>
<source>The host address is not known yet. Trying later again.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationpluginmennekes.cpp" line="372"/>
<location filename="../integrationpluginmennekes.cpp" line="497"/>
<location filename="../integrationpluginmennekes.cpp" line="387"/>
<location filename="../integrationpluginmennekes.cpp" line="515"/>
<source>Error communicating with the wallbox.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../integrationpluginmennekes.cpp" line="398"/>
<source>The firmware version of this wallbox is too old. Please upgrade the firmware to at least version 5.22.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Mennekes</name>