Implement customizable BG speech alerts based on user-defined conditions #276
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Advanced Customization in Speech Announcements for BG Levels
This PR enhances the speech announcement functionality for monitoring blood glucose (BG) levels with advanced customization options, giving users precise control over the conditions that trigger verbal alerts. These improvements aim to support diverse user needs for BG monitoring and alerts.
Enhancements include:
Always Speak: Ensures continuous verbal updates of BG levels at every data refresh, ideal for constant monitoring.
Low BG Alert: Triggers announcements for BG levels at or below the user-defined
alertLowBG
threshold, including a confirmation announcement when levels return to normal, enhancing user reassurance during hypoglycemic events.Proactive Low BG Alert: A significant update providing early warnings for potential low BG scenarios:
alertLowBG
threshold, offering a predictive alert to preemptively manage potential lows.High BG Alert: Informs users when BG levels reach or surpass the
alertHighBG
threshold, with an additional alert when returning to the desired range, aiding in high BG level management.Implementation Details:
The
evaluateSpeakConditions
function centralizes the logic for these enhancements, checking against user preferences and current BG conditions to determine the necessity and type of announcement. This approach ensures a modular and easily adaptable system for future refinements or additions to speech alerts.These updates aim to empower users with more nuanced control over BG alerts, supporting proactive management of glucose levels with timely and relevant information.