Skip to content

Commit

Permalink
Reduce smart alerting and smart snoozing thresholds for the High aler…
Browse files Browse the repository at this point in the history
…ts (#2612)

* Reduce smart alerting and smart snoozing thresholds for the High alerts

* To do documentation

---------

Co-authored-by: Navid <Navid200@users.noreply.github.com>
  • Loading branch information
Navid200 and Navid200 committed Apr 7, 2024
1 parent efb3322 commit 6e9758f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,7 @@ public static boolean trendingToAlertEnd(Context context, boolean above) {
return false;
}

// TODO: Should we add documentation to address possible misbehavior in case of 1-minute readings?
if(above == false) {
// This is a low alert, we should be going up
if((latest.get(0).calculated_value - latest.get(1).calculated_value > 4) ||
Expand All @@ -2049,8 +2050,8 @@ public static boolean trendingToAlertEnd(Context context, boolean above) {
}
} else {
// This is a high alert we should be heading down
if((latest.get(1).calculated_value - latest.get(0).calculated_value > 4) ||
(latest.get(2).calculated_value - latest.get(0).calculated_value > 10)) {
if((latest.get(1).calculated_value - latest.get(0).calculated_value > 1) ||
(latest.get(2).calculated_value - latest.get(0).calculated_value > 2)) {
Log.d(TAG_ALERT, "trendingToAlertEnd returning true for high alert");
return true;
}
Expand Down

0 comments on commit 6e9758f

Please sign in to comment.