alfred.py: ignore non-parseable locations

This commit is contained in:
Nils Schneider 2014-03-30 13:19:54 +02:00
parent d6bd31f8d0
commit fbc5c636df

View file

@ -13,7 +13,10 @@ class alfred:
for mac,node in alfred_data.items(): for mac,node in alfred_data.items():
node_alias = {} node_alias = {}
if 'location' in node: if 'location' in node:
try:
node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude']) node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
except:
pass
try: try:
node_alias['firmware'] = node['software']['firmware']['release'] node_alias['firmware'] = node['software']['firmware']['release']