openaps / decocare

python serial driver for mm comlink2 protocol
Other
27 stars 29 forks source link

insulin sensitivities above 255 decoded incorrectly #5

Closed moomoobloo closed 8 years ago

moomoobloo commented 8 years ago

ReadInsulinSensitivities assumes only 1 byte is used for insulin sensitivity. But when the sensitivity is > 255, the pump sets an additional overflow bit. That bit is currently being decoded as part of the time component, so both the time and sensitivity end up being wrong.

On a 523 pump I observed the following in both dev and master: 12am - 256

    {
      "i": 64, 
      "start": "08:00:00", 
      "sensitivity": 0, 
      "offset": 1920, 
      "x": 0
    }

11:30pm - 300

    {
      "i": 111, 
      "start": "07:30:00", 
      "sensitivity": 44, 
      "offset": 3330, 
      "x": 1
    }
bewest commented 8 years ago

Fixed in release 0.0.31 :tada: