diff --git a/modules-power/src/main/java/eu/darken/octi/modules/power/core/alert/PowerAlertManager.kt b/modules-power/src/main/java/eu/darken/octi/modules/power/core/alert/PowerAlertManager.kt index 13da2b38..63c8a20e 100644 --- a/modules-power/src/main/java/eu/darken/octi/modules/power/core/alert/PowerAlertManager.kt +++ b/modules-power/src/main/java/eu/darken/octi/modules/power/core/alert/PowerAlertManager.kt @@ -83,10 +83,10 @@ class PowerAlertManager @Inject constructor( when (rule) { is BatteryLowAlertRule -> { - val isTriggered = - !powerState.data.isCharging && powerState.data.battery.percent < rule.threshold - val isRecovered = - powerState.data.battery.percent > (rule.threshold + 0.05f).coerceAtMost(0.95f) + val isTriggered = !powerState.data.isCharging && + powerState.data.battery.percent < rule.threshold + val isRecovered = powerState.data.isCharging || + powerState.data.battery.percent > (rule.threshold + 0.05f).coerceAtMost(0.95f) when { event == null && isTriggered && !isRecovered -> { log(TAG, INFO) { "Rule has triggered" }