You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 8, 2026. It is now read-only.
There is already a
SensorsBatteryBlock, but it is based onPollingBlock. Instead, let's reimplement it usingsysfsinterface (https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power) andFileWatcherBlock(based onaionotify).Some posts in StackOverflow on how to calculate the remaining time:
https://stackoverflow.com/questions/26888636/how-to-calculate-the-time-remaining-until-the-end-of-the-battery-charge
https://stackoverflow.com/questions/35516424/calculate-time-left-until-battery-is-discharged
(They're probably not precise, but I don't think the current battery calculations from
psutilare different from this).