Skip to content

Commit

Permalink
[LuxtronikHeatpump] fix channel type of newly defined unknown channels (
Browse files Browse the repository at this point in the history
openhab#11937)

Signed-off-by: Stefan Giehl <stefangiehl@gmail.com>
  • Loading branch information
sgiehl authored and moesterheld committed Jan 18, 2022
1 parent b7cb37e commit 2055257
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,12 @@ private void updateChannels(HeatpumpConnector connector) {
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());
Expand Down

0 comments on commit 2055257

Please sign in to comment.