AAPS-Omnipod / AndroidAPS

GNU Affero General Public License v3.0
21 stars 19 forks source link

Fix SMS response values for basal rate and duration when setting TBR via SMS #12

Closed samspycher closed 3 years ago

samspycher commented 3 years ago

Treating TBR via SMS works well, however the response SMS sent by AAPS contains values of -1 for both the new temp basal rate and the duration in minutes (see image below).

Recording this issue at the current knowledge state for now, and will update with matching log messages and/or further insight later.

Screenshot 2020-10-02 at 21 52 36
samspycher commented 3 years ago

A further look at the code reveals that these values are missing from the OmnipodPumpPlugin response.

AapsOmnipodManager seems to return a relatively minimalist PumpEnactResult => L484:

return new PumpEnactResult(injector).success(true).enacted(true); 

This return object e.g. does not contain the enacted duration and rate.

Looking further down the chain, called methods are missing return values (AapsOmnipodManager.setTemporaryBasal), to set the response with. However the Action itself (SetTempBasalAction) does seem to return a StatusResponse, which may contain the relevant items (rate and duration set by the pod).

If StatusResponse turns out to contain the required values, the return values in methods can be adapted to enrich the SMS response with appropriate data.

bartsopers commented 3 years ago

Fixed by @samspycher