Allow supported A and B series editions
This commit is contained in:
parent
2a2d9dcdff
commit
8baf921119
@ -185,12 +185,32 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the product code and check if the model actually supports the communication
|
// Parse the product code and check if the model actually supports the UDP/Modbus communication
|
||||||
// Only series X and C support UDP/Modbus
|
// Supported are:
|
||||||
|
// - The A series (german edition), no meter DE440 (green edition)
|
||||||
|
// - The B series (german edition), no meter DE440
|
||||||
|
// - All C series
|
||||||
|
// - All X series
|
||||||
|
|
||||||
if (productInformation.isValid()) {
|
if (productInformation.isValid()) {
|
||||||
|
|
||||||
bool supported = false;
|
bool supported = false;
|
||||||
// This model does not support communication with smart devices.
|
|
||||||
|
qCDebug(dcKeba()) << "Product information are valid. Evaluating if model supports UDP/Modbus communication...";
|
||||||
|
|
||||||
switch (productInformation.series()) {
|
switch (productInformation.series()) {
|
||||||
|
case KebaProductInfo::SeriesA:
|
||||||
|
if (productInformation.model() == "P30" && productInformation.germanEdition()) {
|
||||||
|
qCDebug(dcKeba()) << "The P30 A series german edition is supported (DE440 GREEN EDITION)";
|
||||||
|
supported = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case KebaProductInfo::SeriesB:
|
||||||
|
if (productInformation.model() == "P30" && productInformation.germanEdition()) {
|
||||||
|
qCDebug(dcKeba()) << "The P30 B series german edition is supported (DE440)";
|
||||||
|
supported = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case KebaProductInfo::SeriesC:
|
case KebaProductInfo::SeriesC:
|
||||||
case KebaProductInfo::SeriesXWlan:
|
case KebaProductInfo::SeriesXWlan:
|
||||||
case KebaProductInfo::SeriesXWlan3G:
|
case KebaProductInfo::SeriesXWlan3G:
|
||||||
@ -205,10 +225,12 @@ void IntegrationPluginKeba::setupThing(ThingSetupInfo *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
qCWarning(dcKeba()) << "Connected successfully to Keba but this" << productInformation.series() << "has no communication module.";
|
qCWarning(dcKeba()) << "Connected successfully to Keba but this model" << productInformation.series() << "has no communication module.";
|
||||||
info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("This model does not support communication with smart devices."));
|
info->finish(Thing::ThingErrorHardwareFailure, QT_TR_NOOP("This model does not support communication with smart devices."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
qCWarning(dcKeba()) << "Product information are not valid. Cannot determin if this model supports UDP/Modbus communication, assuming yes so let's try to init...";
|
||||||
}
|
}
|
||||||
|
|
||||||
m_kebaDevices.insert(thing->id(), keba);
|
m_kebaDevices.insert(thing->id(), keba);
|
||||||
|
|||||||
@ -186,6 +186,8 @@ KebaProductInfo::KebaProductInfo(const QString &productString) :
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_germanEdition = m_productString.toUpper().endsWith("DE");
|
||||||
|
qCDebug(dcKeba()) << "German Edition:" << m_germanEdition;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool KebaProductInfo::isValid() const
|
bool KebaProductInfo::isValid() const
|
||||||
@ -247,3 +249,8 @@ KebaProductInfo::Authorization KebaProductInfo::authorization() const
|
|||||||
{
|
{
|
||||||
return m_authorization;
|
return m_authorization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool KebaProductInfo::germanEdition() const
|
||||||
|
{
|
||||||
|
return m_germanEdition;
|
||||||
|
}
|
||||||
|
|||||||
@ -112,6 +112,7 @@ public:
|
|||||||
int phaseCount() const; // 1 or 3
|
int phaseCount() const; // 1 or 3
|
||||||
Meter meter() const; // No meter, Calibrated, ...
|
Meter meter() const; // No meter, Calibrated, ...
|
||||||
Authorization authorization() const;
|
Authorization authorization() const;
|
||||||
|
bool germanEdition() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_isValid = true;
|
bool m_isValid = true;
|
||||||
@ -127,6 +128,7 @@ private:
|
|||||||
int m_phaseCount;
|
int m_phaseCount;
|
||||||
Meter m_meter;
|
Meter m_meter;
|
||||||
Authorization m_authorization;
|
Authorization m_authorization;
|
||||||
|
bool m_germanEdition = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // KEBAPRODUCTINFO_H
|
#endif // KEBAPRODUCTINFO_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user