alfred.py: Transfer more data from alfred into the alias list
This commit is contained in:
parent
37db42b51e
commit
02a2862ca9
30
alfred.py
30
alfred.py
|
@ -13,12 +13,36 @@ 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:
|
||||||
|
if 'latitude' in node['location'] and 'longitude' in node['location']:
|
||||||
node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
|
node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
|
||||||
|
|
||||||
try:
|
if 'software' in node:
|
||||||
|
|
||||||
|
if 'firmware' in node['software']:
|
||||||
|
if 'base' in node['software']['firmware']:
|
||||||
|
node_alias['firmware-base'] = node['software']['firmware']['base']
|
||||||
|
if 'release' in node['software']['firmware']:
|
||||||
node_alias['firmware'] = node['software']['firmware']['release']
|
node_alias['firmware'] = node['software']['firmware']['release']
|
||||||
except KeyError:
|
|
||||||
pass
|
if 'autoupdater' in node['software']:
|
||||||
|
if 'branch' in node['software']['autoupdater']:
|
||||||
|
node_alias['autoupdater-branch'] = node['software']['autoupdater']['branch']
|
||||||
|
if 'enabled' in node['software']['autoupdater']:
|
||||||
|
node_alias['autoupdater-enabled'] = node['software']['autoupdater']['enabled']
|
||||||
|
|
||||||
|
if 'fastd' in node['software']:
|
||||||
|
if 'enabled' in node['software']['fastd']:
|
||||||
|
node_alias['fastd-enabled'] = node['software']['fastd']['enabled']
|
||||||
|
if 'version' in node['software']['fastd']:
|
||||||
|
node_alias['fastd-version'] = node['software']['fastd']['version']
|
||||||
|
|
||||||
|
if 'hardware' in node:
|
||||||
|
if 'model' in node['hardware']:
|
||||||
|
node_alias['hardware-model'] = node['hardware']['model']
|
||||||
|
|
||||||
|
if 'network' in node:
|
||||||
|
if 'gateway' in node['network']:
|
||||||
|
node_alias['selected-gateway'] = node['network']['gateway']
|
||||||
|
|
||||||
if 'hostname' in node:
|
if 'hostname' in node:
|
||||||
node_alias['name'] = node['hostname']
|
node_alias['name'] = node['hostname']
|
||||||
|
|
Loading…
Reference in a new issue