import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
import org.openhab.binding.amazondashbutton.internal.capturing.PacketCapturingHandler;
import org.openhab.binding.amazondashbutton.internal.capturing.PacketCapturingService;
import org.openhab.core.config.discovery.DiscoveryResult;
import org.openhab.core.config.discovery.DiscoveryResultBuilder;
import org.openhab.core.config.discovery.DiscoveryService;
+import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingUID;
import org.osgi.service.component.annotations.Component;
import org.pcap4j.core.PcapNetworkInterface;
* The Amazon Dash button vendor prefixes
*/
// @formatter:off
- private static final Set<String> VENDOR_PREFIXES = Collections.unmodifiableSet(Stream.of(
+ private static final Set<String> VENDOR_PREFIXES = Set.of(
"F0:D2:F1",
"88:71:E5",
"FC:A1:83",
"84:D6:D0",
"34:D2:70",
"B4:7C:9C"
- ).collect(Collectors.toSet()));
+ );
// @formatter:on
/**
// @formatter:off
DiscoveryResult discoveryResult = DiscoveryResultBuilder.create(dashButtonThing)
.withLabel("Dash Button")
- .withRepresentationProperty(macAdressString)
- .withProperty(PROPERTY_MAC_ADDRESS, macAdressString)
+ .withRepresentationProperty(Thing.PROPERTY_MAC_ADDRESS)
+ .withProperty(Thing.PROPERTY_MAC_ADDRESS, macAdressString)
.withProperty(PROPERTY_NETWORK_INTERFACE_NAME, interfaceName)
.withProperty(PROPERTY_PACKET_INTERVAL, BigDecimal.valueOf(5000))
.build();