class documentation

class Battery:

Constructor: Battery()

View In Hierarchy

Class for battery information and management.

Method __del__ Destructor to clean up resources.
Method __init__ Initialize the battery interface for the current board.
Property has_voltage Returns True if the battery voltage can be read, False otherwise.
Property percentage Returns the current battery level as a percentage (0-100).
Property voltage Returns the current battery voltage in millivolts.
def __del__(self):

Destructor to clean up resources.

def __init__(self):

Initialize the battery interface for the current board.

@property
has_voltage: bool =

Returns True if the battery voltage can be read, False otherwise.

@property
percentage: int =

Returns the current battery level as a percentage (0-100).

@property
voltage: float =

Returns the current battery voltage in millivolts.