From bf134657ccdcfaf9a94c3b953a3307a49cbd041b Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 20 Jan 2025 15:30:37 -0500 Subject: [PATCH] [insteon] Limit device request failure condition (#18136) Signed-off-by: Jeremy Setton --- .../binding/insteon/internal/device/BaseDevice.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/device/BaseDevice.java b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/device/BaseDevice.java index fc8a24a726c..13ce6a32dac 100644 --- a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/device/BaseDevice.java +++ b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/device/BaseDevice.java @@ -563,7 +563,6 @@ public abstract class BaseDevice<@NonNull T extends DeviceAddress, @NonNull S ex * @param feature the feature queried */ protected void featureQueriedAnswered(DeviceFeature feature) { - // store current failed request count int prevCount = failedRequestCount; // reset failed request count failedRequestCount = 0; @@ -583,8 +582,11 @@ public abstract class BaseDevice<@NonNull T extends DeviceAddress, @NonNull S ex * @param feature the feature queried */ protected void featureQueriedFailed(DeviceFeature feature) { - // increase failed request count - failedRequestCount++; + QueryStatus queryStatus = feature.getQueryStatus(); + // increase failed request count if in sent or acked status + if (queryStatus == QueryStatus.QUERY_SENT || queryStatus == QueryStatus.QUERY_ACKED) { + failedRequestCount++; + } // mark feature queried as processed and never queried setFeatureQueried(null); feature.setQueryMessage(null);