mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-30 17:12:01 +01:00
[insteon] Limit device request failure condition (#18136)
Signed-off-by: Jeremy Setton <jeremy.setton@gmail.com>
This commit is contained in:
parent
1357374746
commit
bf134657cc
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user