diff --git a/alfred.py b/alfred.py index c92bc12..63296c9 100755 --- a/alfred.py +++ b/alfred.py @@ -23,6 +23,11 @@ class alfred: except KeyError: pass + try: + node_alias['id'] = node['network']['mac'] + except KeyError: + pass + if 'hostname' in node: node_alias['name'] = node['hostname'] elif 'name' in node: diff --git a/nodedb.py b/nodedb.py index 6a4726f..25c0e8c 100644 --- a/nodedb.py +++ b/nodedb.py @@ -191,6 +191,9 @@ class NodeDB: if 'firmware' in alias: node.firmware = alias['firmware'] + if 'id' in alias: + node.id = alias['id'] + # list of macs # if options['gateway']: # mark_gateways(options['gateway'])