forked from platypush/platypush
Type should actually always be there
This commit is contained in:
parent
5e3b41c3ad
commit
01c5bbadcd
1 changed files with 2 additions and 3 deletions
|
@ -51,8 +51,7 @@ class PushbulletBackend(Backend):
|
||||||
if not isinstance(msg, dict): return True # We received something weird
|
if not isinstance(msg, dict): return True # We received something weird
|
||||||
|
|
||||||
is_duplicate=False
|
is_duplicate=False
|
||||||
msgtype = msg['type'] if 'type' in msg else 'notype'
|
last_msg = self._last_received_msg[msg['type']]
|
||||||
last_msg = self._last_received_msg[msgtype]
|
|
||||||
|
|
||||||
if last_msg:
|
if last_msg:
|
||||||
msg = Message.parse(msg)
|
msg = Message.parse(msg)
|
||||||
|
@ -63,7 +62,7 @@ class PushbulletBackend(Backend):
|
||||||
logging.debug('Ignoring duplicate message received on the socket')
|
logging.debug('Ignoring duplicate message received on the socket')
|
||||||
is_duplicate = True
|
is_duplicate = True
|
||||||
|
|
||||||
self._last_received_msg[msgtype] = {
|
self._last_received_msg[msg['type']] = {
|
||||||
'body': msg, 'time': time.time()
|
'body': msg, 'time': time.time()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue