diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2014-01-29 23:16:10 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2014-01-29 23:39:25 +0100 |
commit | 25bf597031e3de0cadfe3298570af29e4c20de25 (patch) | |
tree | 0440288a085bd4e2f18334bfd662bbcdfcc827d7 | |
parent | Add connect/disconnect methods to otultra2 and send \x11\r on connection. (diff) | |
download | glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar.gz glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar.bz2 glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar.lz glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar.xz glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.tar.zst glucometerutils-25bf597031e3de0cadfe3298570af29e4c20de25.zip |
Diffstat (limited to '')
-rw-r--r-- | glucometerutils/common.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/glucometerutils/common.py b/glucometerutils/common.py index 38f735e..a9968c2 100644 --- a/glucometerutils/common.py +++ b/glucometerutils/common.py @@ -54,7 +54,7 @@ _ReadingBase = collections.namedtuple( '_ReadingBase', ['timestamp', 'value', 'meal', 'comment']) class Reading(_ReadingBase): - def __init__(self, timestamp, value, meal='', comment=''): + def __new__(cls, timestamp, value, meal='', comment=''): """Constructor for the reading object. Args: @@ -67,8 +67,8 @@ class Reading(_ReadingBase): because at least most of the LifeScan devices report the raw data in this format. """ - super(Reading, self).__init__( - timestamp=timestamp, value=value, meal=meal, comment=comment) + return super(Reading, cls).__new__( + cls, timestamp=timestamp, value=value, meal=meal, comment=comment) def get_value_as(self, to_unit): """Returns the reading value as the given unit. |