Skip to content

Commit

Permalink
Merge 3eabe68 into cecf7dd
Browse files Browse the repository at this point in the history
  • Loading branch information
stv0g committed Mar 3, 2019
2 parents cecf7dd + 3eabe68 commit d97a9ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions enocean/communicators/communicator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
from __future__ import print_function, unicode_literals, division, absolute_import
import logging
import datetime

import threading
try:
Expand Down Expand Up @@ -67,6 +68,7 @@ def parse(self):

# If message is OK, add it to receive queue or send to the callback method
if status == PARSE_RESULT.OK and packet:
packet.received = datetime.datetime.now()
if self.__callback is None:
self.receive.put(packet)
else:
Expand Down
2 changes: 2 additions & 0 deletions enocean/protocol/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def __init__(self, packet_type, data=None, optional=None):
self.rorg_type = None
self.rorg_manufacturer = None

self.received = None

if not isinstance(data, list) or data is None:
self.logger.warning('Replacing Packet.data with default value.')
self.data = []
Expand Down

0 comments on commit d97a9ba

Please sign in to comment.