Skip to content

battery

Utilities for retrieving battery information of macOS host

Functions:

get_battery_details

get_battery_details() -> Dict[str, int | bool]

Function to return battery details

Returns:

  • Dict[str, int | bool]

    Dict of battery details (percent, power_plugged, secsleft)

get_battery_details_2

get_battery_details_2() -> Dict[str, int | bool]

Function to return battery details (via pmset CLI)

Returns:

  • Dict[str, int | bool]

    Dict of battery details (percent, power_plugged)