From ac074ea1f0f02fe3535c0d5d1253188317e6ff73 Mon Sep 17 00:00:00 2001 From: miloit Date: Sun, 13 Dec 2020 13:52:40 +0100 Subject: [PATCH] [yioremote] Bug fix during websocket error by disposing pollingjob (#9350) * Bug fix during websocket error by disposing pollingjob Signed-off-by: Michael Loercher --- .../binding/yioremote/internal/YIOremoteDockHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.openhab.binding.yioremote/src/main/java/org/openhab/binding/yioremote/internal/YIOremoteDockHandler.java b/bundles/org.openhab.binding.yioremote/src/main/java/org/openhab/binding/yioremote/internal/YIOremoteDockHandler.java index 0c3bfe8a5..41767b877 100644 --- a/bundles/org.openhab.binding.yioremote/src/main/java/org/openhab/binding/yioremote/internal/YIOremoteDockHandler.java +++ b/bundles/org.openhab.binding.yioremote/src/main/java/org/openhab/binding/yioremote/internal/YIOremoteDockHandler.java @@ -139,14 +139,17 @@ public class YIOremoteDockHandler extends BaseThingHandler { @Override public void onClose() { + disposeWebsocketPollingJob(); reconnectWebsocket(); } @Override public void onError(Throwable cause) { + disposeWebsocketPollingJob(); yioRemoteDockActualStatus = YioRemoteDockHandleStatus.COMMUNICATION_ERROR; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Communication lost no ping from YIO DOCK"); + reconnectWebsocket(); } });