Perform init when the connection is reachable instead of connected.
parent
ee65c18400
commit
d11a9eb38d
|
|
@ -119,9 +119,9 @@ void IntegrationPluginPhoenixConnect::setupThing(ThingSetupInfo *info)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(connection, &PhoenixModbusTcpConnection::connectionStateChanged, thing, [connection, thing](bool status){
|
connect(connection, &PhoenixModbusTcpConnection::reachableChanged, thing, [connection, thing](bool reachable){
|
||||||
qCDebug(dcPhoenixContact()) << "Connection state changed" << status;
|
qCDebug(dcPhoenixContact()) << "Reachable state changed" << reachable;
|
||||||
if (status) {
|
if (reachable) {
|
||||||
connection->initialize();
|
connection->initialize();
|
||||||
} else {
|
} else {
|
||||||
thing->setStateValue("connected", false);
|
thing->setStateValue("connected", false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue