bugfix
This commit is contained in:
parent
03853a8ac0
commit
f7417f0939
|
@ -190,9 +190,13 @@ class NodeDB:
|
||||||
|
|
||||||
macs = [s for s in [s.strip() for s in node['MAC'].split(',')] if s]
|
macs = [s for s in [s.strip() for s in node['MAC'].split(',')] if s]
|
||||||
gps = [s for s in [s.strip() for s in node['GPS'].split(',')] if s]
|
gps = [s for s in [s.strip() for s in node['GPS'].split(',')] if s]
|
||||||
|
if 'MAC' in node:
|
||||||
names = [s for s in [s.strip() for s in node['Nick'].split(',')] if s]
|
names = [s for s in [s.strip() for s in node['Nick'].split(',')] if s]
|
||||||
|
zipped = zip(macs, gps, names)
|
||||||
|
else:
|
||||||
|
zipped = zip(macs, gps)
|
||||||
|
|
||||||
for pair in zip(macs, gps, names):
|
for pair in zipped:
|
||||||
try:
|
try:
|
||||||
node = self.maybe_node_by_mac((pair[0], ))
|
node = self.maybe_node_by_mac((pair[0], ))
|
||||||
except:
|
except:
|
||||||
|
@ -200,6 +204,7 @@ class NodeDB:
|
||||||
node.add_mac(pair[0])
|
node.add_mac(pair[0])
|
||||||
self._nodes.append(node)
|
self._nodes.append(node)
|
||||||
|
|
||||||
|
if '2' in pair:
|
||||||
if pair[2]:
|
if pair[2]:
|
||||||
node.name = pair[2]
|
node.name = pair[2]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue