https://bugs.kde.org/show_bug.cgi?id=434432
--- Comment #15 from Stefan Brüns <stefan.bru...@rwth-aachen.de> --- Git commit e6fdb5b169f3da6f08c89ee1a425f1f00ce902b7 by Stefan Brüns. Committed on 20/04/2023 at 22:43. Pushed by bruns into branch 'master'. Fix and consolidate discharge rate and remaining time calculation This fixes several issues in the current code: 1. Instead of averaging the remaining time it averages the discharge rate, and uses the rate and remaining energy to calculate the time. 2. It gets rid of the history array, an autoregressive filter only needs one history value, no point recalculating it again and again. 3. It keeps the averaged discharge rate over plug/unplug events. This reduces the error after replugging, as the first few reported rate values are often too small, while there is no intrinsic reason the old rate estimate becomes invalid. 4. It brings the legacy remaining time calculation in line with the one based on the DisplayDevice UPower object, i.e. always uses rate and remaining energy to full/empty to calculate the time. M +19 -29 daemon/backends/upower/powerdevilupowerbackend.cpp M +38 -31 daemon/powerdevilbackendinterface.cpp M +3 -1 daemon/powerdevilbackendinterface.h https://invent.kde.org/plasma/powerdevil/commit/e6fdb5b169f3da6f08c89ee1a425f1f00ce902b7 -- You are receiving this mail because: You are watching all bug changes.