mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
parent
c7ce929aa2
commit
0a5a9912a5
@ -16,6 +16,7 @@ import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@ -152,10 +153,9 @@ public class BluetoothDiscoveryService extends AbstractDiscoveryService implemen
|
||||
public void deviceDiscovered(BluetoothDevice device) {
|
||||
logger.debug("Discovered bluetooth device '{}': {}", device.getName(), device);
|
||||
|
||||
DiscoveryCache cache = discoveryCaches.computeIfAbsent(device.getAddress(), addr -> new DiscoveryCache());
|
||||
if (cache != null) {
|
||||
cache.handleDiscovery(device);
|
||||
}
|
||||
DiscoveryCache cache = Objects
|
||||
.requireNonNull(discoveryCaches.computeIfAbsent(device.getAddress(), addr -> new DiscoveryCache()));
|
||||
cache.handleDiscovery(device);
|
||||
}
|
||||
|
||||
private static ThingUID createThingUIDWithBridge(DiscoveryResult result, BluetoothAdapter adapter) {
|
||||
|
Loading…
Reference in New Issue
Block a user