def dispatch(pkt): src = pkt[Ether].src if src in buttons: now = time.time() if lastseen[src] == 0 or lastseen[src] < now - interval: lastseen[src] = now rx(buttons[src])