[insteon] Limit device request failure condition (#18136)

Signed-off-by: Jeremy Setton <jeremy.setton@gmail.com>
This commit is contained in:
Jeremy 2025-01-20 15:30:37 -05:00 committed by GitHub
parent 1357374746
commit bf134657cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -563,7 +563,6 @@ public abstract class BaseDevice<@NonNull T extends DeviceAddress, @NonNull S ex
* @param feature the feature queried * @param feature the feature queried
*/ */
protected void featureQueriedAnswered(DeviceFeature feature) { protected void featureQueriedAnswered(DeviceFeature feature) {
// store current failed request count
int prevCount = failedRequestCount; int prevCount = failedRequestCount;
// reset failed request count // reset failed request count
failedRequestCount = 0; failedRequestCount = 0;
@ -583,8 +582,11 @@ public abstract class BaseDevice<@NonNull T extends DeviceAddress, @NonNull S ex
* @param feature the feature queried * @param feature the feature queried
*/ */
protected void featureQueriedFailed(DeviceFeature feature) { protected void featureQueriedFailed(DeviceFeature feature) {
// increase failed request count QueryStatus queryStatus = feature.getQueryStatus();
failedRequestCount++; // 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 // mark feature queried as processed and never queried
setFeatureQueried(null); setFeatureQueried(null);
feature.setQueryMessage(null); feature.setQueryMessage(null);