Browse Source

Added timestamp to messages.

pyserial_fix
Scott Petersen 11 years ago
parent
commit
3034e14920
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      alarmdecoder/messages.py

+ 5
- 1
alarmdecoder/messages.py View File

@@ -13,6 +13,7 @@ devices.
"""

import re
import datetime

from .util import InvalidMessageError

@@ -25,11 +26,14 @@ class BaseMessage(object):
raw = None
"""The raw message text"""

timestamp = None
"""The timestamp of the message"""

def __init__(self):
"""
Constructor
"""
pass
self.timestamp = datetime.datetime.now()

def __str__(self):
"""


Loading…
Cancel
Save