mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-27 07:41:39 +01:00
Fix MAC comparison (#8768)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
This commit is contained in:
parent
61d8608685
commit
dab6df14fd
@ -14,6 +14,7 @@ package org.openhab.binding.ambientweather.internal.handler;
|
|||||||
|
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
@ -109,11 +110,12 @@ public class AmbientWeatherEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private AmbientWeatherStationHandler getHandler(String macAddress) {
|
private AmbientWeatherStationHandler getHandler(String macAddress) {
|
||||||
logger.debug("Listener: Search for MAC {} in handlers list with {} entries", macAddress, handlers.size());
|
logger.debug("Listener: Search for MAC {} in handlers list with {} entries: {}", macAddress, handlers.size(),
|
||||||
|
Arrays.asList(handlers.values()));
|
||||||
for (Map.Entry<AmbientWeatherStationHandler, String> device : handlers.entrySet()) {
|
for (Map.Entry<AmbientWeatherStationHandler, String> device : handlers.entrySet()) {
|
||||||
AmbientWeatherStationHandler handler = device.getKey();
|
AmbientWeatherStationHandler handler = device.getKey();
|
||||||
String mac = device.getValue();
|
String mac = device.getValue();
|
||||||
if (mac.equals(macAddress)) {
|
if (mac.equalsIgnoreCase(macAddress)) {
|
||||||
logger.debug("Listener: Found handler for {} with MAC {}", handler.getThing().getUID(), macAddress);
|
logger.debug("Listener: Found handler for {} with MAC {}", handler.getThing().getUID(), macAddress);
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user