From 93a7fd7956b83b9c7d7c6837706868c31c79dc3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 30 Sep 2022 11:58:34 +0200 Subject: [PATCH] Fix #86 set connected state of child things --- kostal/integrationpluginkostal.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kostal/integrationpluginkostal.cpp b/kostal/integrationpluginkostal.cpp index 78cb8d4..3acd738 100644 --- a/kostal/integrationpluginkostal.cpp +++ b/kostal/integrationpluginkostal.cpp @@ -345,10 +345,12 @@ void IntegrationPluginKostal::setupKostalConnection(ThingSetupInfo *info) if (!thing->setupComplete()) return; - if (success) { - thing->setStateValue("connected", true); - } else { - thing->setStateValue("connected", false); + thing->setStateValue("connected", success); + foreach (Thing *childThing, myThings().filterByParentId(thing->id())) { + childThing->setStateValue("connected", success); + } + + if (!success) { // Try once to reconnect the device kostalConnection->reconnectDevice(); }