From b9a0e6fa14e3834ec79a1f6b3d78161a65e70122 Mon Sep 17 00:00:00 2001 From: mlobstein Date: Fri, 1 Sep 2023 16:16:16 -0500 Subject: [PATCH] Fix Reconnect error race condition (#15536) Signed-off-by: Michael Lobstein --- .../internal/handler/MonopriceAudioHandler.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/handler/MonopriceAudioHandler.java b/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/handler/MonopriceAudioHandler.java index 2c3a2024a..d54c25908 100644 --- a/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/handler/MonopriceAudioHandler.java +++ b/bundles/org.openhab.binding.monopriceaudio/src/main/java/org/openhab/binding/monopriceaudio/internal/handler/MonopriceAudioHandler.java @@ -482,7 +482,6 @@ public class MonopriceAudioHandler extends BaseThingHandler implements Monoprice String error = null; if (openConnection()) { - long prevUpdateTime = lastPollingUpdate; // poll all zones on the amplifier to get current state amp.getZoneIds().stream().limit(numZones).forEach((streamZoneId) -> { try { @@ -505,11 +504,6 @@ public class MonopriceAudioHandler extends BaseThingHandler implements Monoprice logger.debug("Error sending Xantech periodic update commands: {}", e.getMessage()); } } - - // prevUpdateTime should have changed if a zone update was received - if (lastPollingUpdate == prevUpdateTime) { - error = "@text/offline.communication-error-polling"; - } } else { error = "@text/offline.communication-error-reconnection"; } @@ -518,7 +512,6 @@ public class MonopriceAudioHandler extends BaseThingHandler implements Monoprice updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, error); } else { updateStatus(ThingStatus.ONLINE); - lastPollingUpdate = System.currentTimeMillis(); } } }