]> git.basschouten.com Git - openhab-addons.git/commitdiff
[LuxtronikHeatpump] fix channel type of newly defined unknown channels (#11937)
authorStefan Giehl <stefangiehl@gmail.com>
Sun, 2 Jan 2022 15:57:41 +0000 (16:57 +0100)
committerGitHub <noreply@github.com>
Sun, 2 Jan 2022 15:57:41 +0000 (16:57 +0100)
Signed-off-by: Stefan Giehl <stefangiehl@gmail.com>
bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/LuxtronikHeatpumpHandler.java

index 1ebd8697e492f38d6418cc8a94eaca986363cdd1..a7131f9d618059e3c1116ddc2d54e3f7c29efce5 100644 (file)
@@ -277,8 +277,12 @@ public class LuxtronikHeatpumpHandler extends BaseThingHandler {
             Integer channelId = channel.getChannelId();
             int length = channel.isWritable() ? heatpumpParams.length : heatpumpValues.length;
             ChannelUID channelUID = new ChannelUID(thing.getUID(), channel.getCommand());
-            ChannelTypeUID channelTypeUID = new ChannelTypeUID(LuxtronikHeatpumpBindingConstants.BINDING_ID,
-                    channel.getCommand());
+            ChannelTypeUID channelTypeUID;
+            if (channel.getCommand().matches("^channel[0-9]+$")) {
+                channelTypeUID = new ChannelTypeUID(LuxtronikHeatpumpBindingConstants.BINDING_ID, "unknown");
+            } else {
+                channelTypeUID = new ChannelTypeUID(LuxtronikHeatpumpBindingConstants.BINDING_ID, channel.getCommand());
+            }
             if ((channelId != null && length <= channelId)
                     || (config.showAllChannels == Boolean.FALSE && !channel.isVisible(visibilityValues))) {
                 logger.debug("Hiding channel {}", channel.getCommand());