From: cedricboon Date: Sun, 9 May 2021 18:24:07 +0000 (+0200) Subject: [velbus] Fixed parsing of channel bytes on VMB4AN. (#10627) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=54d899c3fe765f2484e3d22744a8a23ad3fe1b04;p=openhab-addons.git [velbus] Fixed parsing of channel bytes on VMB4AN. (#10627) Signed-off-by: Cedric Boon --- diff --git a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java index cc3f40c8b7..ad09711cbb 100644 --- a/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java +++ b/bundles/org.openhab.binding.velbus/src/main/java/org/openhab/binding/velbus/internal/handler/VelbusVMB4ANHandler.java @@ -232,7 +232,7 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { } protected byte convertAlarmChannelUIDToChannelByte(ChannelUID channelUID) { - return Byte.parseByte(channelUID.getIdWithoutGroup()); + return Byte.parseByte(channelUID.getIdWithoutGroup().replaceAll(CHANNEL, "")); } protected boolean isTextAnalogInputChannel(ChannelUID channelUID) { @@ -246,11 +246,12 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { } protected byte convertRawAnalogInputChannelUIDToChannelByte(ChannelUID channelUID) { - return Byte.parseByte(channelUID.getIdWithoutGroup().replaceAll(RAW_CHANNEL_SUFFIX, "")); + return Byte + .parseByte(channelUID.getIdWithoutGroup().replaceAll(CHANNEL, "").replaceAll(RAW_CHANNEL_SUFFIX, "")); } protected byte convertTextAnalogInputChannelUIDToChannelByte(ChannelUID channelUID) { - return Byte.parseByte(channelUID.getIdWithoutGroup()); + return Byte.parseByte(channelUID.getIdWithoutGroup().replaceAll(CHANNEL, "")); } protected String convertAnalogInputChannelByteToRawChannelUID(byte channelByte) { @@ -258,7 +259,7 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { } protected String convertAnalogInputChannelByteToChannelUID(byte channelByte) { - return ANALOG_INPUT_GROUP + "#" + channelByte; + return ANALOG_INPUT_GROUP + "#" + CHANNEL + channelByte; } protected boolean isAnalogOutputChannel(ChannelUID channelUID) { @@ -266,7 +267,7 @@ public class VelbusVMB4ANHandler extends VelbusSensorWithAlarmClockHandler { } protected byte convertAnalogOutputChannelUIDToChannelByte(ChannelUID channelUID) { - return Byte.parseByte(channelUID.getIdWithoutGroup()); + return Byte.parseByte(channelUID.getIdWithoutGroup().replaceAll(CHANNEL, "")); } @Override