[LuxtronikHeatpump] fix channel type of newly defined unknown channels (#11937)

Signed-off-by: Stefan Giehl <stefangiehl@gmail.com>
This commit is contained in:
Stefan Giehl 2022-01-02 16:57:41 +01:00 committed by GitHub
parent 6deb3f56da
commit 2d32067533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -277,8 +277,12 @@ public class LuxtronikHeatpumpHandler extends BaseThingHandler {
Integer channelId = channel.getChannelId(); Integer channelId = channel.getChannelId();
int length = channel.isWritable() ? heatpumpParams.length : heatpumpValues.length; int length = channel.isWritable() ? heatpumpParams.length : heatpumpValues.length;
ChannelUID channelUID = new ChannelUID(thing.getUID(), channel.getCommand()); ChannelUID channelUID = new ChannelUID(thing.getUID(), channel.getCommand());
ChannelTypeUID channelTypeUID = new ChannelTypeUID(LuxtronikHeatpumpBindingConstants.BINDING_ID, ChannelTypeUID channelTypeUID;
channel.getCommand()); 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) if ((channelId != null && length <= channelId)
|| (config.showAllChannels == Boolean.FALSE && !channel.isVisible(visibilityValues))) { || (config.showAllChannels == Boolean.FALSE && !channel.isVisible(visibilityValues))) {
logger.debug("Hiding channel {}", channel.getCommand()); logger.debug("Hiding channel {}", channel.getCommand());