File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -210,14 +210,17 @@ Battery::determineWarning(bool connected)
210
210
{
211
211
if (connected) {
212
212
// propagate warning state only if the state is higher, otherwise remain in current warning state
213
- if (_remaining < _param_bat_emergen_thr.get () || (_warning == battery_status_s::BATTERY_WARNING_EMERGENCY) ) {
213
+ if (_remaining < _param_bat_emergen_thr.get ()) {
214
214
_warning = battery_status_s::BATTERY_WARNING_EMERGENCY;
215
215
216
- } else if (_remaining < _param_bat_crit_thr.get () || (_warning == battery_status_s::BATTERY_WARNING_CRITICAL) ) {
216
+ } else if (_remaining < _param_bat_crit_thr.get ()) {
217
217
_warning = battery_status_s::BATTERY_WARNING_CRITICAL;
218
218
219
- } else if (_remaining < _param_bat_low_thr.get () || (_warning == battery_status_s::BATTERY_WARNING_LOW) ) {
219
+ } else if (_remaining < _param_bat_low_thr.get ()) {
220
220
_warning = battery_status_s::BATTERY_WARNING_LOW;
221
+
222
+ } else {
223
+ _warning = battery_status_s::BATTERY_WARNING_NONE;
221
224
}
222
225
}
223
226
}
You can’t perform that action at this time.
0 commit comments