Commit d2eda12f authored by Kasalehlia's avatar Kasalehlia

now even more dependebru

parent 07fe578f
......@@ -59,6 +59,13 @@ def alfred_server(config, alfred_channels,batadv_data):
channel = rdata[1]
message = rdata[2]
node = json.loads(message)
if 'node_id' in node: #dependable way
mac = node['node_id']
mac = ':'.join([mac[i:i+2] for i in range(0,len(mac),2)])
elif 'network' in node: #fallback
mac = node['network']['mac']
else: #fuck you
continue
mac = node['node_id']
mac = ':'.join([mac[i:i+2] for i in range(0,len(mac),2)])
if str(channel) not in alfred_channels:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment