[velbus] Fixed parsing of channel bytes on VMB4AN. (#10627)

Signed-off-by: Cedric Boon <cedric.boon@hotmail.com>
This commit is contained in:
cedricboon 2021-05-09 20:24:07 +02:00 committed by GitHub
parent ca3ee153c4
commit 54d899c3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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