From ba7c0ee4e6443594494c9d2783abf5bcbfdbec19 Mon Sep 17 00:00:00 2001
From: Simone Margaritelli <evilsocket@gmail.com>
Date: Sun, 13 Oct 2019 18:29:56 +0200
Subject: [PATCH] misc: small fix or general refactoring i did not bother
 commenting

---
 pwnagotchi/log.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pwnagotchi/log.py b/pwnagotchi/log.py
index fa3ddc1..560a6ce 100644
--- a/pwnagotchi/log.py
+++ b/pwnagotchi/log.py
@@ -129,10 +129,12 @@ class LastSession(object):
                 if m:
                     name, pubkey, rssi, sid, pwnd_tot, uptime = m[0]
                     if pubkey not in cache:
-                        self.last_peer = Peer(sid, 1, int(rssi),
-                                              {'name': name,
-                                               'identity': pubkey,
-                                               'pwnd_tot': int(pwnd_tot)})
+                        self.last_peer = Peer({
+                            'session_id': sid,
+                            'channel': 1,
+                            'rssi': int(rssi),
+                            'identity': pubkey,
+                            'advertisement':{'pwnd_tot': int(pwnd_tot)}})
                         self.peers += 1
                         cache[pubkey] = self.last_peer
                     else: