Skip to content

Commit

Permalink
fixes to Ian50Body, Ian50
Browse files Browse the repository at this point in the history
For @tghoward et al to test, per bewest/decoding-carelink#156


Former-commit-id: b1123ae81bd59a6064c396070285694a42092b40
Former-commit-id: 9fb2a07a66605698e57307a449aeb9df79bf1ecc [formerly fe23c735d807ec0840486707383f7344392d9cd8]
Former-commit-id: 9b86a5093b368f65ad92a2e111df9cef0fee4db6
Former-commit-id: 1c6386098ba30e2c99c67e7e055b86595647ea80
  • Loading branch information
bewest committed Jan 10, 2016
1 parent 70c7014 commit fd98051
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion decocare/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ class Ian69(KnownRecord):
class Ian50(KnownRecord):
opcode = 0x50
body_length = 34

# XXX: tghoward testing on 723 at length 30
body_length = 30
def __init__ (self, head, model, **kwds):
super(Ian50, self).__init__(head, model, **kwds)
self.body_length = model.Ian50Body
_confirmed.append(Ian50)

class Ian54(KnownRecord):
Expand Down Expand Up @@ -702,7 +708,7 @@ def decode (self):
try:
return (dict(valid_date=date(*mid).isoformat()))
except ValueError, e:
return (dict(error_date=mid))
return (dict(error_date=mid, error=str(e)))

_confirmed.append(Sara6E)

Expand Down
3 changes: 3 additions & 0 deletions decocare/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class PumpModel (object):
basal_strokes = 40
MMOL_DEFAULT = False
larger = False
Ian50Body = 30
def __init__(self, model, session):
self.model = model
self.session = session
Expand Down Expand Up @@ -254,9 +255,11 @@ class Model723 (Model523):
pass

class Model530 (Model523):
Ian50Body = 34
pass

class Model730 (Model530):
Ian50Body = 34
pass

class Model540 (Model530):
Expand Down

0 comments on commit fd98051

Please sign in to comment.