diff options
author | Bastien Nocera <hadess@hadess.net> | 2017-04-05 15:59:25 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2017-04-06 14:18:10 +0200 |
commit | 27a3eea5e5a5a39acd22f67994a4ba4027faf201 (patch) | |
tree | b589d50b83757370062b5b0c69f0b93bd3869801 | |
parent | c237298297e3015753b0ad237e5e9260b20dd493 (diff) | |
download | upower-27a3eea5e5a5a39acd22f67994a4ba4027faf201.tar.gz |
daemon: Make warning levels for devices inclusive
A 5% battery level should already be in "critical", this matches the
configurable thresholds where the bounds of critical warnings are
inclusive. This also makes it easier to create fake percentages for the
Logitech devices with coarse battery level reporting.
https://bugs.freedesktop.org/show_bug.cgi?id=100359
-rw-r--r-- | src/up-daemon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/up-daemon.c b/src/up-daemon.c index d506c4b..54dcec7 100644 --- a/src/up-daemon.c +++ b/src/up-daemon.c @@ -645,9 +645,9 @@ up_daemon_compute_warning_level (UpDaemon *daemon, * into critical (or off) before any warnings */ if (kind == UP_DEVICE_KIND_MOUSE || kind == UP_DEVICE_KIND_KEYBOARD) { - if (percentage < 5.0f) + if (percentage <= 5.0f) return UP_DEVICE_LEVEL_CRITICAL; - else if (percentage < 10.0f) + else if (percentage <= 10.0f) return UP_DEVICE_LEVEL_LOW; else return UP_DEVICE_LEVEL_NONE; |