Handle reconfigure
This commit is contained in:
parent
9f1869462a
commit
dba629b173
@ -71,7 +71,7 @@ void FroniusNetworkReply::setNetworkReply(QNetworkReply *networkReply)
|
|||||||
{
|
{
|
||||||
m_networkReply = 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);
|
connect(m_networkReply, &QNetworkReply::finished, this, &FroniusNetworkReply::finished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,15 @@ void IntegrationPluginFronius::setupThing(ThingSetupInfo *info)
|
|||||||
if (thing->thingClassId() == connectionThingClassId) {
|
if (thing->thingClassId() == connectionThingClassId) {
|
||||||
|
|
||||||
QHostAddress address(thing->paramValue(connectionThingAddressParamTypeId).toString());
|
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);
|
FroniusSolarConnection *connection = new FroniusSolarConnection(hardwareManager()->networkManager(), address, thing);
|
||||||
|
|
||||||
// Verify the version
|
// Verify the version
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user