From 291b30955b1d4754d766fa6ea38dc19e9e07c112 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Fri, 25 Dec 2020 22:15:54 +0100 Subject: [PATCH] [tr064] Adds new channels for DSL Max & Current Down-/Upstream Rate (#9519) Signed-off-by: Stefan Giehl --- bundles/org.openhab.binding.tr064/README.md | 4 ++++ .../internal/soap/SOAPValueConverter.java | 3 +++ .../src/main/resources/channels.xml | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/bundles/org.openhab.binding.tr064/README.md b/bundles/org.openhab.binding.tr064/README.md index 3690b83db73..9017484a871 100644 --- a/bundles/org.openhab.binding.tr064/README.md +++ b/bundles/org.openhab.binding.tr064/README.md @@ -78,12 +78,16 @@ This is an optional parameter and multiple values are allowed. | `callList` | `String` | x | A string containing the call list as JSON (see below) | | `deviceLog` | `String` | x | A string containing the last log messages | | `dslCRCErrors` | `Number:Dimensionless` | x | DSL CRC Errors | +| `dslDownstreamMaxRate` | `Number:DataTransferRate` | x | DSL Max Downstream Rate | +| `dslDownstreamCurrRate` | `Number:DataTransferRate` | x | DSL Curr. Downstream Rate | | `dslDownstreamNoiseMargin` | `Number:Dimensionless` | x | DSL Downstream Noise Margin | | `dslDownstreamAttenuation` | `Number:Dimensionless` | x | DSL Downstream Attenuation | | `dslEnable` | `Switch` | | DSL Enable | | `dslFECErrors` | `Number:Dimensionless` | x | DSL FEC Errors | | `dslHECErrors` | `Number:Dimensionless` | x | DSL HEC Errors | | `dslStatus` | `Switch` | | DSL Status | +| `dslUpstreamMaxRate` | `Number:DataTransferRate` | x | DSL Max Upstream Rate | +| `dslUpstreamCurrRate` | `Number:DataTransferRate` | x | DSL Curr. Upstream Rate | | `dslUpstreamNoiseMargin` | `Number:Dimensionless` | x | DSL Upstream Noise Margin | | `dslUpstreamAttenuation` | `Number:Dimensionless` | x | DSL Upstream Attenuation | | `inboundCalls` | `Number` | x | Number of inbound calls within the given number of days. | 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 f653d238366..e3436141acd 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 @@ -85,6 +85,7 @@ public class SOAPValueConverter { switch (dataType) { case "ui2": return Optional.of(String.valueOf(value.shortValue())); + case "i4": case "ui4": return Optional.of(String.valueOf(value.intValue())); default: @@ -94,6 +95,7 @@ public class SOAPValueConverter { switch (dataType) { case "ui2": return Optional.of(String.valueOf(value.shortValue())); + case "i4": case "ui4": return Optional.of(String.valueOf(value.intValue())); default: @@ -132,6 +134,7 @@ public class SOAPValueConverter { case "string": return new StringType(rawValue); case "ui2": + case "i4": case "ui4": if (!unit.isEmpty()) { return new QuantityType<>(rawValue + " " + unit); 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 a321c7066ea..be6743f0643 100644 --- a/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml +++ b/bundles/org.openhab.binding.tr064/src/main/resources/channels.xml @@ -194,6 +194,30 @@ serviceId="urn:WANDSLIfConfig-com:serviceId:WANDSLInterfaceConfig1"/> + + + + + + + + + + + + + + + + + + + +