Commit 07fe578f authored by Kasalehlia's avatar Kasalehlia

more reliable way of retrieving entitie's mac

parent a6491c8e
......@@ -59,7 +59,8 @@ def alfred_server(config, alfred_channels,batadv_data):
channel = rdata[1]
message = rdata[2]
node = json.loads(message)
mac = node['network']['mac']
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:
alfred_channels[str(channel)] = {mac : node}
alfred_channels[str(channel)][mac]['time'] = int(time.time())
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment