Skip to content
This repository was archived by the owner on Jan 8, 2026. It is now read-only.
This repository was archived by the owner on Jan 8, 2026. It is now read-only.

Create BatteryBlock using FileWatcherBlock #85

@thiagokokada

Description

@thiagokokada

There is already a SensorsBatteryBlock, but it is based on PollingBlock. Instead, let's reimplement it using sysfs interface (https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-power) and FileWatcherBlock (based on aionotify).

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 psutil are different from this).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions