alfred: Make the alfred based batadv-vis data source optional.
This commit is contained in:
parent
4c4e8d846b
commit
319b071fd8
|
@ -47,12 +47,12 @@ db = NodeDB()
|
|||
if options['mesh']:
|
||||
for mesh_interface in options['mesh']:
|
||||
bm = batman(mesh_interface)
|
||||
db.parse_vis_data(bm.vis_data())
|
||||
db.parse_vis_data(bm.vis_data(options['alfred']))
|
||||
for gw in bm.gateway_list():
|
||||
db.mark_gateways(gw.mac)
|
||||
else:
|
||||
bm = batman()
|
||||
db.parse_vis_data(bm.vis_data())
|
||||
db.parse_vis_data(bm.vis_data(options['alfred']))
|
||||
for gw in bm.gateway_list():
|
||||
db.mark_gateways([gw['mac']])
|
||||
|
||||
|
|
|
@ -9,8 +9,11 @@ class batman:
|
|||
def __init__(self, mesh_interface = "bat0"):
|
||||
self.mesh_interface = mesh_interface
|
||||
|
||||
def vis_data(self):
|
||||
return self.vis_data_batadv_vis() + self.vis_data_batctl_legacy()
|
||||
def vis_data(self,batadv_vis=False):
|
||||
vds = self.vis_data_batctl_legacy()
|
||||
if batadv_vis:
|
||||
vds += self.vis_data_batadv_vis()
|
||||
return vds
|
||||
|
||||
def vis_data_helper(self,lines):
|
||||
vd = []
|
||||
|
|
Loading…
Reference in a new issue