From dc27a0cee72e55da52edf42381e5d517d9430523 Mon Sep 17 00:00:00 2001 From: lolodomo Date: Sun, 2 Aug 2020 15:56:13 +0200 Subject: [PATCH] [rotel] Thread name format updated (#8238) Related to #8216 Signed-off-by: Laurent Garnier Signed-off-by: MPH80 --- .../openhab/binding/rotel/internal/RotelBindingConstants.java | 2 -- .../rotel/internal/communication/RotelReaderThread.java | 1 + .../openhab/binding/rotel/internal/handler/RotelHandler.java | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java index c8594e2b8bc8e..eedcc41344719 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/RotelBindingConstants.java @@ -151,6 +151,4 @@ public class RotelBindingConstants { // List of all properties public static final String PROPERTY_PROTOCOL = "protocol"; - - public static final String THREAD_NAME_PREFIX = "OH-" + BINDING_ID + "-"; } diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java index 909eafc65fbd9..2f3f0e7a4478b 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/communication/RotelReaderThread.java @@ -38,6 +38,7 @@ public class RotelReaderThread extends Thread { * Constructor * * @param connector the object that should handle the received message + * @param threadName the name of the thread */ public RotelReaderThread(RotelConnector connector, String threadName) { super(threadName); diff --git a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java index 556b2de9071dc..a365d899cecbe 100644 --- a/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java +++ b/bundles/org.openhab.binding.rotel/src/main/java/org/openhab/binding/rotel/internal/handler/RotelHandler.java @@ -87,7 +87,7 @@ public class RotelHandler extends BaseThingHandler implements RotelMessageEventL private SerialPortManager serialPortManager; private RotelConnector connector = new RotelSimuConnector(DEFAULT_MODEL, RotelProtocol.HEX, new HashMap<>(), - THREAD_NAME_PREFIX); + "OH-binding-rotel"); private int minVolume; private int maxVolume; @@ -292,7 +292,7 @@ public void initialize() { Map sourcesLabels = new HashMap<>(); - String readerThreadName = THREAD_NAME_PREFIX + getThing().getUID().getAsString(); + String readerThreadName = "OH-binding-" + getThing().getUID().getAsString(); connector = new RotelSimuConnector(rotelModel, rotelProtocol, sourcesLabels, readerThreadName);