nightscout / Trio

MIT License
49 stars 154 forks source link

Remaining carbs cap allows 'illegal' value #189

Open LiroyvH opened 2 months ago

LiroyvH commented 2 months ago

According to https://docs.diy-trio.org/en/latest/settings/configuration/preferences/othersettings.html#remaining-carbs-cap a value of 90 is the absolute minimum for "Remaining Carbs Cap" in Preferences (all the wayyyy at the bottom :)). However, the app allows you to set a value far lower than that. If the limit is supposed to be 90 at the lowest in accordance with the docs, not accepting lower values in that field may be a good idea.

dsut4392 commented 1 month ago

I do not agree that values below 90 should be 'illegal'. The purpose of this variable is to set a limit on the maximum amount of carbs allowed to remain after 4h. Apart from the docs saying so, can anyone articulate a reason why the remaining carbs cap shouldn't be set lower than 90? A significant proportion of people will never have a COB anywhere near 90 even right after a meal, let alone 4 hours later, so for those people setting 90 as a hard limit for this variable means it serves no purpose at all. E.g. my son typically consumes less than 90g carbs per day. From determine-basal.js, line 1243-1244: var remainingCarbs = Math.max(0, meal_data.mealCOB - totalCA - meal_data.carbs*remainingCarbsIgnore); remainingCarbs = Math.min(remainingCarbsCap,remainingCarbs);

[the infotext in PreferencesEditorStateModel.swift is also incorrect, I will log an issue report]

Sjoerd-Bo3 commented 1 week ago

hey 👋 - silence for 30 days 🤐 ... anybody? triage is required!