From 4c441355f85f0551fc1815aa489f3bb0d934ee50 Mon Sep 17 00:00:00 2001 From: docbender Date: Wed, 11 Nov 2020 21:48:26 +0100 Subject: [PATCH] Refactoring --- .../src/main/feature/feature.xml | 21 +-- .../handler/simaticBridgeHandler.java | 2 +- .../resources/OH-INF/thing/thing-types.xml | 137 +++++++++--------- 3 files changed, 75 insertions(+), 85 deletions(-) diff --git a/org.openhab.binding.simatic/src/main/feature/feature.xml b/org.openhab.binding.simatic/src/main/feature/feature.xml index d6257c0..93bc4ea 100644 --- a/org.openhab.binding.simatic/src/main/feature/feature.xml +++ b/org.openhab.binding.simatic/src/main/feature/feature.xml @@ -1,21 +1,10 @@ - + - mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features - + mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features + openhab-runtime-base mvn:org.openhab.addons.bundles/org.openhab.binding.simatic/${project.version} diff --git a/org.openhab.binding.simatic/src/main/java/org/openhab/binding/simatic/internal/handler/simaticBridgeHandler.java b/org.openhab.binding.simatic/src/main/java/org/openhab/binding/simatic/internal/handler/simaticBridgeHandler.java index e4f6756..ebbcb25 100644 --- a/org.openhab.binding.simatic/src/main/java/org/openhab/binding/simatic/internal/handler/simaticBridgeHandler.java +++ b/org.openhab.binding.simatic/src/main/java/org/openhab/binding/simatic/internal/handler/simaticBridgeHandler.java @@ -195,7 +195,7 @@ public void initialize() { @Override protected void updateState(@Nullable ChannelUID channel, State state) { if (channel == null) { - logger.error("{} - updateState(...) channelID is null for state={}", getThing().getLabel(), state); + logger.debug("{} - updateState(...) channelID is null for state={}", getThing().getLabel(), state); return; } // logger.debug("{} - update channelID={}, state={}", getThing().getLabel(), channel, state); diff --git a/org.openhab.binding.simatic/src/main/resources/OH-INF/thing/thing-types.xml b/org.openhab.binding.simatic/src/main/resources/OH-INF/thing/thing-types.xml index e99e8d2..1e078c3 100644 --- a/org.openhab.binding.simatic/src/main/resources/OH-INF/thing/thing-types.xml +++ b/org.openhab.binding.simatic/src/main/resources/OH-INF/thing/thing-types.xml @@ -8,14 +8,14 @@ Represent single PLC or more exactly its connection, which uses individual things. - - - - - - - - + + + + + + + + @@ -33,26 +33,27 @@ 2 - - Determine period of data read from device. - 1000 - true - - - - Define code page for communicated strings (e.g. ISO-8859-1, cp1250). If blank or wrong code page is defined, system code page is used. - - true - + + Determine period of data read from device. + 1000 + true + + + + Define code page for communicated strings (e.g. ISO-8859-1, cp1250). If blank or wrong code page is + defined, system code page is used. + + true + Which type of communication should be established. Possibilities are PG, OP, S7 (default). S7 - - - - + + + + true @@ -75,51 +76,51 @@ - - - String - - Binding version - - - - Number - - Negotiated PDU size - - - - Number - - Communicated PLC data areas count - - - - String - - Communicated PLC data areas - - - - Number - - Channels count - - - - Number - - Requests per second to device - - - - Number - - Bytes per second grabbed from device - - - - + + + String + + Binding version + + + + Number + + Negotiated PDU size + + + + Number + + Communicated PLC data areas count + + + + String + + Communicated PLC data areas + + + + Number + + Channels count + + + + Number + + Requests per second to device + + + + Number + + Bytes per second grabbed from device + + + + Number