mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Fix for getting device names using Luci. Tested on Barier Breaker.
This commit is contained in:
parent
f1843a57e0
commit
f110dc970d
@ -114,12 +114,13 @@ class LuciDeviceScanner(object):
|
|||||||
hosts = [x for x in result.values()
|
hosts = [x for x in result.values()
|
||||||
if x['.type'] == 'host' and
|
if x['.type'] == 'host' and
|
||||||
'mac' in x and 'name' in x]
|
'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)
|
self.mac2name = dict(mac2name_list)
|
||||||
else:
|
else:
|
||||||
# Error, handled in the _req_json_rpc
|
# Error, handled in the _req_json_rpc
|
||||||
return
|
return
|
||||||
return self.mac2name.get(device, None)
|
return self.mac2name.get(device.upper(), None)
|
||||||
|
|
||||||
@Throttle(MIN_TIME_BETWEEN_SCANS)
|
@Throttle(MIN_TIME_BETWEEN_SCANS)
|
||||||
def _update_info(self):
|
def _update_info(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user