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 #156
  • Loading branch information
bewest committed Jan 10, 2016
1 parent 22524b2 commit b1123ae
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 b1123ae

Please sign in to comment.