diff --git a/bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler/ServerHandler.java b/bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler/ServerHandler.java index 5ba705ca7b9..36927250c99 100644 --- a/bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler/ServerHandler.java +++ b/bundles/org.openhab.binding.freeboxos/src/main/java/org/openhab/binding/freeboxos/internal/handler/ServerHandler.java @@ -192,10 +192,8 @@ public class ServerHandler extends ApiConsumerHandler implements FreeDeviceIntf updateRateBandwidth(status.rateUp(), status.bandwidthUp(), "up"); updateRateBandwidth(status.rateDown(), status.bandwidthDown(), "down"); - updateChannelQuantity(GROUP_CONNECTION_STATUS, BYTES_UP, new QuantityType<>(status.bytesUp(), OCTET), - GIBIOCTET); - updateChannelQuantity(GROUP_CONNECTION_STATUS, BYTES_DOWN, new QuantityType<>(status.bytesDown(), OCTET), - GIBIOCTET); + updateChannelQuantity(GROUP_CONNECTION_STATUS, BYTES_UP, status.bytesUp(), OCTET); + updateChannelQuantity(GROUP_CONNECTION_STATUS, BYTES_DOWN, status.bytesDown(), OCTET); } if (anyChannelLinked(GROUP_FTTH, Set.of(SFP_PRESENT, SFP_ALIM, SFP_POWER, SFP_SIGNAL, SFP_LINK, SFP_PWR_TX, SFP_PWR_RX))) { @@ -218,14 +216,12 @@ public class ServerHandler extends ApiConsumerHandler implements FreeDeviceIntf } private void updateRateBandwidth(long rate, long bandwidth, String orientation) { - QuantityType rateUp = new QuantityType<>(rate * 8, Units.BIT_PER_SECOND); + QuantityType rateUp = new QuantityType<>(rate * 8, BIT_PER_SECOND); QuantityType bandwidthUp = new QuantityType<>(bandwidth, BIT_PER_SECOND); - updateChannelQuantity(GROUP_CONNECTION_STATUS, RATE + "-" + orientation, rateUp, KILOBIT_PER_SECOND); - updateChannelQuantity(GROUP_CONNECTION_STATUS, BW + "-" + orientation, bandwidthUp, KILOBIT_PER_SECOND); + updateChannelQuantity(GROUP_CONNECTION_STATUS, RATE + "-" + orientation, rateUp); + updateChannelQuantity(GROUP_CONNECTION_STATUS, BW + "-" + orientation, bandwidthUp); updateChannelQuantity(GROUP_CONNECTION_STATUS, PCT_BW + "-" + orientation, - !bandwidthUp.equals(QuantityType.ZERO) ? rateUp.multiply(HUNDRED).divide(bandwidthUp) - : QuantityType.ZERO, - Units.PERCENT); + !bandwidthUp.equals(QuantityType.ZERO) ? rateUp.divide(bandwidthUp) : QuantityType.ZERO, PERCENT); } @Override diff --git a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/i18n/freeboxos.properties b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/i18n/freeboxos.properties index f8889950ce7..663b4b942b0 100644 --- a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/i18n/freeboxos.properties +++ b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/i18n/freeboxos.properties @@ -214,8 +214,6 @@ channel-type.freeboxos.alarm-volume.label = Alarm Volume channel-type.freeboxos.alternate-ring.label = Alternating Ring channel-type.freeboxos.bandwidth-usage.label = Bandwidth Usage channel-type.freeboxos.bandwidth-usage.description = Current bandwidth usage -channel-type.freeboxos.bandwidth.label = Bandwidth -channel-type.freeboxos.bandwidth.description = Available bandwidth channel-type.freeboxos.basic-shutter.label = Shutter channel-type.freeboxos.basic-shutter.description = Shutter command channel-type.freeboxos.box-event.label = Server Event diff --git a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/thing/channel-types.xml b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/thing/channel-types.xml index 65c6dd67949..4dee0b5198b 100644 --- a/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/thing/channel-types.xml +++ b/bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/thing/channel-types.xml @@ -5,11 +5,11 @@ xsi:schemaLocation="https://openhab.org/schemas/thing-description/v1.0.0 https://openhab.org/schemas/thing-description-1.0.0.xsd"> - Number:Dimensionless + Number:Dimensionless Brightness level of the screen in percent Light - + @@ -104,40 +104,33 @@ - Number:Dimensionless + Number:Dimensionless Current bandwidth usage - + - Number:DataTransferRate + Number:DataTransferRate Current transfer rate - Number:DataTransferRate + Number:DataTransferRate Current transfer rate - + - Number:DataAmount + Number:DataAmount Total data transfered since last connection - - Number:DataTransferRate - - Available bandwidth - - - Number:Time @@ -451,7 +444,7 @@ Number:Dimensionless oh:freeboxos:sirene - +