]> git.basschouten.com Git - openhab-addons.git/commitdiff
Fix MAC comparison (#8768)
authorMark Hilbush <mark@hilbush.com>
Sat, 17 Oct 2020 14:46:36 +0000 (10:46 -0400)
committerGitHub <noreply@github.com>
Sat, 17 Oct 2020 14:46:36 +0000 (16:46 +0200)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java

index 031675e6f8461ae979c37a19d94dc2634cb5f540..ec521827ca18f6911c73e4b3483b04070f4c3e3b 100644 (file)
@@ -14,6 +14,7 @@ package org.openhab.binding.ambientweather.internal.handler;
 
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -109,11 +110,12 @@ public class AmbientWeatherEventListener {
     }
 
     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()) {
             AmbientWeatherStationHandler handler = device.getKey();
             String mac = device.getValue();
-            if (mac.equals(macAddress)) {
+            if (mac.equalsIgnoreCase(macAddress)) {
                 logger.debug("Listener: Found handler for {} with MAC {}", handler.getThing().getUID(), macAddress);
                 return handler;
             }