Skip to content

Commit

Permalink
[ambientweather] Fix MAC address comparison (#8825)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Hilbush <mark@hilbush.com>
  • Loading branch information
mhilbush authored Oct 21, 2020
1 parent 1ffdeca commit 209870e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand Down Expand Up @@ -109,11 +110,12 @@ private void sendWeatherDataToHandler(String macAddress, String jsonData) {
}

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;
}
Expand Down

0 comments on commit 209870e

Please sign in to comment.