Przeglądaj źródła
Format Rec. Bolus with the pump's bolus increment (#700)
* Format Loop's recommended bolus with InsulinMetric
The Loop device status parser formatted Rec. Bolus with a hardcoded
String(format: "%.2fU"), while the OpenAPS/Trio parser routed the value
through InsulinMetric. The same recommendation rendered as "0.00U" on a
Loop URL and "0" on a Trio URL. Use InsulinMetric on both paths.
* Format Rec. Bolus with the pump's bolus increment
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.