From: Stefan Giehl Date: Sun, 2 Jan 2022 15:57:41 +0000 (+0100) Subject: [LuxtronikHeatpump] fix channel type of newly defined unknown channels (#11937) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=2d32067533af8bfadc78ce152015270f2c546568;p=openhab-addons.git [LuxtronikHeatpump] fix channel type of newly defined unknown channels (#11937) Signed-off-by: Stefan Giehl --- diff --git a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/LuxtronikHeatpumpHandler.java b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/LuxtronikHeatpumpHandler.java index 1ebd8697e4..a7131f9d61 100644 --- a/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/LuxtronikHeatpumpHandler.java +++ b/bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/LuxtronikHeatpumpHandler.java @@ -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());