diff --git a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/soap/SOAPValueConverter.java b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/soap/SOAPValueConverter.java index e175b22273d05..788bf20d785a6 100644 --- a/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/soap/SOAPValueConverter.java +++ b/bundles/org.openhab.binding.tr064/src/main/java/org/openhab/binding/tr064/internal/soap/SOAPValueConverter.java @@ -38,6 +38,7 @@ import org.openhab.core.library.types.OnOffType; import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.StringType; +import org.openhab.core.library.unit.Units; import org.openhab.core.types.Command; import org.openhab.core.types.State; import org.openhab.core.types.UnDefType; @@ -200,6 +201,20 @@ private State processMacSignalStrength(State state, Tr064ChannelConfig channelCo return mappedSignalStrength; } + /** + * post processor for decibel values (which are served as deca decibel) + * + * @param state the channel value in deca decibel + * @param channelConfig channel config of the channel + * @return the state converted to decibel + */ + @SuppressWarnings("unused") + private State processDecaDecibel(State state, Tr064ChannelConfig channelConfig) { + Float value = state.as(DecimalType.class).floatValue() / 10; + + return new QuantityType(value, Units.DECIBEL); + } + /** * post processor for answering machine new messages channel * diff --git a/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml b/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml index afccf5454851c..489391c7543d6 100644 --- a/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml +++ b/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml @@ -284,25 +284,25 @@ - + - + - + - +