From 209870ee7ac771ad3bee2c5ef5d641d657a2d5c7 Mon Sep 17 00:00:00 2001 From: Mark Hilbush Date: Wed, 21 Oct 2020 14:29:23 -0400 Subject: [PATCH] [ambientweather] Fix MAC address comparison (#8825) Signed-off-by: Mark Hilbush --- .../internal/handler/AmbientWeatherEventListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java index 031675e6f84..ec521827ca1 100644 --- a/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java +++ b/bundles/org.openhab.binding.ambientweather/src/main/java/org/openhab/binding/ambientweather/internal/handler/AmbientWeatherEventListener.java @@ -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 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; }