Skip to content

Commit

Permalink
[netatmo] Discovery: remove older results (openhab#8126)
Browse files Browse the repository at this point in the history
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: MPH80 <michael@hazelden.me>
  • Loading branch information
lolodomo authored and MPH80 committed Aug 3, 2020
1 parent 1809d99 commit 8fb5e23
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/
@NonNullByDefault
public class NetatmoModuleDiscoveryService extends AbstractDiscoveryService implements NetatmoDataListener {
private static final int SEARCH_TIME = 2;
private static final int SEARCH_TIME = 5;
private final NetatmoBridgeHandler netatmoBridgeHandler;

public NetatmoModuleDiscoveryService(NetatmoBridgeHandler netatmoBridgeHandler) {
Expand Down Expand Up @@ -93,7 +93,12 @@ public void startScan() {
});
});
}
stopScan();
}

@Override
protected synchronized void stopScan() {
super.stopScan();
removeOlderResults(getTimestampOfLastScan(), netatmoBridgeHandler.getThing().getUID());
}

@Override
Expand Down

0 comments on commit 8fb5e23

Please sign in to comment.