Amperfied: Verify version number durin discovery
parent
ac47803265
commit
8f2aa88000
|
|
@ -85,6 +85,13 @@ void ConnectHomeDiscovery::checkNetworkDevice(const NetworkDeviceInfo &networkDe
|
||||||
cleanupConnection(connection);
|
cleanupConnection(connection);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (connection->version() < 0x100 || connection->version() > 0x2ff) {
|
||||||
|
qCInfo(dcAmperfied()) << "Skipping invalid/unsupported AMPERFIED version" << connection->version();
|
||||||
|
cleanupConnection(connection);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Result result;
|
Result result;
|
||||||
result.firmwareVersion = connection->version();
|
result.firmwareVersion = connection->version();
|
||||||
result.networkDeviceInfo = networkDeviceInfo;
|
result.networkDeviceInfo = networkDeviceInfo;
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@ IntegrationPluginAmperfied::IntegrationPluginAmperfied()
|
||||||
|
|
||||||
void IntegrationPluginAmperfied::discoverThings(ThingDiscoveryInfo *info)
|
void IntegrationPluginAmperfied::discoverThings(ThingDiscoveryInfo *info)
|
||||||
{
|
{
|
||||||
hardwareManager()->modbusRtuResource();
|
|
||||||
|
|
||||||
if (info->thingClassId() == energyControlThingClassId) {
|
if (info->thingClassId() == energyControlThingClassId) {
|
||||||
EnergyControlDiscovery *discovery = new EnergyControlDiscovery(hardwareManager()->modbusRtuResource(), info);
|
EnergyControlDiscovery *discovery = new EnergyControlDiscovery(hardwareManager()->modbusRtuResource(), info);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue