-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persistent High threshold fix #3752
Conversation
Hi again @Navid200 I'm happy, that is happening now, but I would have (already had back then) an addiontal request - and while you're at it, it might be easier to apply: Would that be possible/easy to apply? |
@Teute0815 No, it is not easy to add. The next item on my list of the required changes to alerts is to find a way to make these alerts use volume profile. I don't believe time of day has a purpose that cannot be addressed by other means. In return, it brings in many recipes for disaster. Of course, I am not the only developer. Others can add it. |
If someone has selected the mmol/L unit and has entered an unreasonable value of for example, 70mmol/L for their persistent high alert threshold, after this PR after they restart xDrip, their threshold will be converted to 70 / 18 = 3.9mmol/L! I wanted to add a conditional to check the setting for having been changed and act accordingly. The problem is it will require dealing with the specific setting. I would like to avoid that so that I can easily use everything for the forecast low alert after this is settled. What do you think? Even though this is not a perfect solution, I feel it is reasonable. This is why: |
I can add a method to IdempotentMigrations, with a parameter to check the setting. On the other hand, if the setting has been changed and it is out of range, the method will limit the value without conversion and issue a notification to inform the user. The method call will require the inclusion of the setting key. If we some day add a forecast low threshold setting, we will have to add it to the list in IdempotentMigrations. But, I prefer that we leave it as is. This PR as is resolves the problem. If we some day add a forecast low threshold, there will be no need to correct anything. |
@Teute0815 Yes, all posts that have no tag address the owner of the repository. PRs are extremely critical and I would appreciate it if you don't use PRs for conversations. We opened the discussions for that. |
@jamorham If you merge this, I can continue to improve it if needed. You did not want me to use handleUnitChange except when the user changed units. I can address that. I can add a simple static method in IdempotentMigrations to address a threshold setting that is greater than the max. This will address both the default conversion at installation when setting is mmol/L as well as those who have changed the setting incorrectly before this is merged. I just don't know how important this is for you and I don't want to delay this any longer because we are taking the chance of more people entering a value out of range. |
I am opening two smaller PRs hoping that they will be easier to review. And if one is not good, the other will hopefully not be held up. |
This PR fixes two issues I caused adding Persistent High threshold (#3704).
1- You can enter any value as persistent high threshold.
This PR rejects all values that are outside the 40-400 mg/dL range.
2- If xDrip is already installed and mmol/L is selected and xDrip is updated to our latest Nightly (2024.10.11), the threshold will be set to 170 mmol/L.
The user will need to change units to mg/dL and back to mmol/L to correct that to 9.4 mmol/L.
This PR does the correction automatically.