Commit 78a9003
committed
Format Rec. Bolus with the pump's bolus increment (#700)
Rec. Bolus was formatted two different ways: the Loop parser used a
hardcoded String(format: "%.2fU"), while the OpenAPS/Trio parser went
through InsulinMetric, which drops to one fraction digit below 10 U. The
same recommendation rendered as "0.00U" on a Loop URL and "0" on a Trio
URL.
Both parsers now use InsulinFormatter, which derives its fraction digits
from the pump's reported bolusIncrement, so the value is shown at the
precision the pump can actually deliver. The unit suffix is dropped to
match the other insulin rows in the info table.
Clear the info row and deviceRecBolus when the device status carries no
recommendation, so a stale value can't linger in the info table, the
Rec. Bolus alarm condition, or the Live Activity.1 parent 4aff865 commit 78a9003
2 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
106 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
| 121 | + | |
121 | 122 | | |
122 | 123 | | |
123 | 124 | | |
| |||
0 commit comments