"""The hub's own battery: how full it is and whether it is charging.
Values update about every 2 seconds.
"""
"""State: not known yet."""
"""State: running on battery, no charger plugged in."""
"""State: plugged in and charging."""
"""State: plugged in and the battery is full."""
[docs]
def voltage() -> int:
"""Battery voltage in millivolts (1000 mV = 1 V). ``0`` if it can't be measured."""
...
[docs]
def percent() -> int:
"""How full the battery is, from 0 to 100 %."""
...
[docs]
def state() -> int:
"""What the battery is doing: ``UNKNOWN``, ``ON_BATTERY``, ``CHARGING`` or ``FULLY_CHARGED``."""
...
[docs]
def charging() -> bool:
"""``True`` while the battery is charging."""
...
[docs]
def fully_charged() -> bool:
"""``True`` when a charger is plugged in and the battery is full."""
...