Merge pull request #148 from fbradyirl/luci-fix

Fix for getting device names using Luci. Tested on Barier Breaker.
pull/152/head
Paulus Schoutsen 2015-05-30 07:46:40 -07:00
commit 43f89209d3
1 changed files with 3 additions and 2 deletions

View File

@ -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):