Handle reconfigure
parent
9f1869462a
commit
dba629b173
|
|
@ -71,7 +71,7 @@ void FroniusNetworkReply::setNetworkReply(QNetworkReply *networkReply)
|
|||
{
|
||||
m_networkReply = networkReply;
|
||||
|
||||
// The QNetworkReply will be deleted in the constructor if set
|
||||
// The QNetworkReply will be deleted in the destructor if set
|
||||
connect(m_networkReply, &QNetworkReply::finished, this, &FroniusNetworkReply::finished);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,6 +110,15 @@ void IntegrationPluginFronius::setupThing(ThingSetupInfo *info)
|
|||
if (thing->thingClassId() == connectionThingClassId) {
|
||||
|
||||
QHostAddress address(thing->paramValue(connectionThingAddressParamTypeId).toString());
|
||||
|
||||
// Handle reconfigure
|
||||
if (m_froniusConnections.values().contains(thing)) {
|
||||
FroniusSolarConnection *oldConnection = m_froniusConnections.key(thing);
|
||||
m_froniusConnections.remove(oldConnection);
|
||||
oldConnection->deleteLater();
|
||||
}
|
||||
|
||||
// Create the connection
|
||||
FroniusSolarConnection *connection = new FroniusSolarConnection(hardwareManager()->networkManager(), address, thing);
|
||||
|
||||
// Verify the version
|
||||
|
|
|
|||
Loading…
Reference in New Issue