From f110dc970df3bce50e4dc75d79b470bcc78a46a1 Mon Sep 17 00:00:00 2001
From: Finbarr Brady <finbarr.brady@gmail.com>
Date: Sat, 30 May 2015 13:30:34 +0000
Subject: [PATCH] Fix for getting device names using Luci. Tested on Barier
 Breaker.

---
 homeassistant/components/device_tracker/luci.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/homeassistant/components/device_tracker/luci.py b/homeassistant/components/device_tracker/luci.py
index 6ff3d996a47..893c9070526 100644
--- a/homeassistant/components/device_tracker/luci.py
+++ b/homeassistant/components/device_tracker/luci.py
@@ -114,12 +114,13 @@ class LuciDeviceScanner(object):
                     hosts = [x for x in result.values()
                              if x['.type'] == 'host' and
                              'mac' in x and 'name' in x]
-                    mac2name_list = [(x['mac'], x['name']) for x in hosts]
+                    mac2name_list = [
+                        (x['mac'].upper(), x['name']) for x in hosts]
                     self.mac2name = dict(mac2name_list)
                 else:
                     # Error, handled in the _req_json_rpc
                     return
-            return self.mac2name.get(device, None)
+            return self.mac2name.get(device.upper(), None)
 
     @Throttle(MIN_TIME_BETWEEN_SCANS)
     def _update_info(self):
-- 
GitLab