Compare commits
2 commits
dev
...
alfred-dat
Author | SHA1 | Date | |
---|---|---|---|
01fa5e7a0b | |||
02a2862ca9 |
34
alfred.py
34
alfred.py
|
@ -13,12 +13,36 @@ class alfred:
|
|||
for mac,node in alfred_data.items():
|
||||
node_alias = {}
|
||||
if 'location' in node:
|
||||
node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
|
||||
if 'latitude' in node['location'] and 'longitude' in node['location']:
|
||||
node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
|
||||
|
||||
try:
|
||||
node_alias['firmware'] = node['software']['firmware']['release']
|
||||
except KeyError:
|
||||
pass
|
||||
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']
|
||||
|
||||
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:
|
||||
node_alias['name'] = node['hostname']
|
||||
|
|
15
nodedb.py
15
nodedb.py
|
@ -188,6 +188,21 @@ class NodeDB:
|
|||
if 'firmware' in alias:
|
||||
node.firmware = alias['firmware']
|
||||
|
||||
if 'firmware-base' in alias:
|
||||
node.firmware-base = alias['firmware-base']
|
||||
|
||||
if 'hardware-model' in alias:
|
||||
node.hardware-model = alias['hardware-model']
|
||||
|
||||
if 'selected-gateway' in alias:
|
||||
node.selected-gateway = alias['selected-gateway']
|
||||
|
||||
if 'autoupdater-branch' in alias:
|
||||
node.autoupdater-branch = alias['autoupdater-branch']
|
||||
|
||||
if 'autoupdater-enabled' in alias:
|
||||
node.autoupdater-branch = alias['autoupdater-enabled']
|
||||
|
||||
# list of macs
|
||||
# if options['gateway']:
|
||||
# mark_gateways(options['gateway'])
|
||||
|
|
Loading…
Reference in a new issue