Avoid controller scan scheduling ping-pong.

This commit is contained in:
Florian Nücke
2022-02-13 16:42:22 +01:00
parent 3615fd1f0c
commit 5f284bab15

View File

@@ -84,8 +84,12 @@ public class CommonDeviceBusController implements DeviceBusController {
@Override
public void scheduleBusScan() {
scanDelay = 0; // scan as soon as possible
state = BusState.SCAN_PENDING;
// For multiple controllers, avoid ping-ponging immediate scans when controllers
// detect each other during their scans.
if (state != BusState.MULTIPLE_CONTROLLERS) {
scanDelay = 0; // scan as soon as possible
state = BusState.SCAN_PENDING;
}
}
@Override