alfred.py: Make geo attribute setting more robust
This commit is contained in:
parent
7075d8481c
commit
89e4c63700
1 changed files with 3 additions and 1 deletions
|
@ -15,8 +15,10 @@ class alfred:
|
|||
for key in node:
|
||||
node_alias[key] = node[key]
|
||||
|
||||
if 'location' in node:
|
||||
try:
|
||||
node_alias['geo'] = [node['location']['latitude'], node['location']['longitude']]
|
||||
except (TypeError, KeyError):
|
||||
pass
|
||||
|
||||
try:
|
||||
node_alias['id'] = node['network']['mac']
|
||||
|
|
Loading…
Add table
Reference in a new issue