Merge branch 'omnipod_eros_dev' into omnipod_eros_dev_upstream_merge

This commit is contained in:
Bart Sopers 2020-12-19 21:09:35 +01:00
commit c7db98a03e

View file

@ -747,14 +747,15 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
pump.put("status", status); pump.put("status", status);
pump.put("extended", extended); pump.put("extended", extended);
// If the reservoir level is over 50 units, we don't know the actual value,
// so only include the reservoir level if it's under 50 units
double reservoirLevel = getReservoirLevel(); double reservoirLevel = getReservoirLevel();
if (reservoirLevel <= OmnipodConstants.MAX_RESERVOIR_READING) { if (reservoirLevel > OmnipodConstants.MAX_RESERVOIR_READING) {
pump.put("reservoir_display_override", "50+");
pump.put("reservoir", OmnipodConstants.MAX_RESERVOIR_READING);
} else {
pump.put("reservoir", reservoirLevel); pump.put("reservoir", reservoirLevel);
} }
pump.put("clock", DateUtil.toISOString(new Date())); pump.put("clock", DateUtil.toISOString(podStateManager.getTime().toDate()));
} catch (JSONException e) { } catch (JSONException e) {
aapsLogger.error(LTag.PUMP, "Unhandled exception", e); aapsLogger.error(LTag.PUMP, "Unhandled exception", e);
} }