]> git.basschouten.com Git - openhab-addons.git/commitdiff
[lcn] Fix initial polling of linked Channels (#9103)
authorFabian Wolter <github@fabian-wolter.de>
Mon, 23 Nov 2020 09:46:20 +0000 (10:46 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Nov 2020 09:46:20 +0000 (10:46 +0100)
Fixes #9086
Relates to openhab/openhab-core#1707

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
bundles/org.openhab.binding.lcn/src/main/java/org/openhab/binding/lcn/internal/LcnModuleHandler.java

index 73588375e2e750cd6becc5d76311f6037cb64026..189625fb1a7c164febabb71b9fde6447757a9a67 100644 (file)
@@ -140,6 +140,13 @@ public class LcnModuleHandler extends BaseThingHandler {
 
             // module is assumed as online, when the corresponding Bridge (PckGatewayHandler) is online.
             updateStatus(ThingStatus.ONLINE);
+
+            // trigger REFRESH commands for all linked Channels to start polling
+            getThing().getChannels().forEach(channel -> {
+                if (isLinked(channel.getUID())) {
+                    channelLinked(channel.getUID());
+                }
+            });
         } catch (LcnException e) {
             updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage());
         }