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']:
|
if options['mesh']:
|
||||||
for mesh_interface in options['mesh']:
|
for mesh_interface in options['mesh']:
|
||||||
bm = batman(mesh_interface)
|
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():
|
for gw in bm.gateway_list():
|
||||||
db.mark_gateways(gw.mac)
|
db.mark_gateways(gw.mac)
|
||||||
else:
|
else:
|
||||||
bm = batman()
|
bm = batman()
|
||||||
db.parse_vis_data(bm.vis_data())
|
db.parse_vis_data(bm.vis_data(options['alfred']))
|
||||||
for gw in bm.gateway_list():
|
for gw in bm.gateway_list():
|
||||||
db.mark_gateways([gw['mac']])
|
db.mark_gateways([gw['mac']])
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,11 @@ class batman:
|
||||||
def __init__(self, mesh_interface = "bat0"):
|
def __init__(self, mesh_interface = "bat0"):
|
||||||
self.mesh_interface = mesh_interface
|
self.mesh_interface = mesh_interface
|
||||||
|
|
||||||
def vis_data(self):
|
def vis_data(self,batadv_vis=False):
|
||||||
return self.vis_data_batadv_vis() + self.vis_data_batctl_legacy()
|
vds = self.vis_data_batctl_legacy()
|
||||||
|
if batadv_vis:
|
||||||
|
vds += self.vis_data_batadv_vis()
|
||||||
|
return vds
|
||||||
|
|
||||||
def vis_data_helper(self,lines):
|
def vis_data_helper(self,lines):
|
||||||
vd = []
|
vd = []
|
||||||
|
|
Loading…
Reference in a new issue