[lcn] Fix initial polling of linked Channels (#9103)

Fixes #9086
Relates to openhab/openhab-core#1707

Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
This commit is contained in:
Fabian Wolter 2020-11-23 10:46:20 +01:00 committed by GitHub
parent fb7fcd886d
commit 417ae41bd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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());
}