firstseen
This commit is contained in:
parent
65655a38bb
commit
48a1744639
1
node.py
1
node.py
|
@ -12,6 +12,7 @@ class Node():
|
|||
self.firmware = None
|
||||
self.clientcount = 0
|
||||
self.lastseen = 0
|
||||
self.firstseen = 0
|
||||
|
||||
def add_mac(self, mac):
|
||||
mac = mac.lower()
|
||||
|
|
|
@ -31,6 +31,7 @@ class NodeDB:
|
|||
obj.append({ 'id': node.id
|
||||
, 'name': node.name
|
||||
, 'lastseen': node.lastseen
|
||||
, 'firstseen': node.firstseen
|
||||
, 'geo': node.gps
|
||||
})
|
||||
|
||||
|
@ -53,6 +54,9 @@ class NodeDB:
|
|||
node.gps = n['geo']
|
||||
self._nodes.append(node)
|
||||
|
||||
if 'firstseen' in n:
|
||||
node.firstseen = n['firstseen']
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -80,6 +84,7 @@ class NodeDB:
|
|||
except:
|
||||
node = Node()
|
||||
node.lastseen = self.time
|
||||
node.firstseen = self.time
|
||||
node.flags['online'] = True
|
||||
self._nodes.append(node)
|
||||
|
||||
|
@ -97,6 +102,7 @@ class NodeDB:
|
|||
except:
|
||||
node = Node()
|
||||
node.lastseen = self.time
|
||||
node.firstseen = self.time
|
||||
node.flags['online'] = True
|
||||
node.add_mac(x['router'])
|
||||
self._nodes.append(node)
|
||||
|
@ -115,6 +121,7 @@ class NodeDB:
|
|||
except:
|
||||
node = Node()
|
||||
node.lastseen = self.time
|
||||
node.firstseen = self.time
|
||||
node.flags['online'] = True
|
||||
node.add_mac(x['neighbor'])
|
||||
self._nodes.append(node)
|
||||
|
|
Loading…
Reference in a new issue