libretro.api.power¶
Types for exposing a frontend’s power status to a Core.
See also
PowerDriverThe
Protocolthat uses these types to expose power status to aCore.libretro.drivers.powerlibretro.py’s included
PowerDriverimplementations.
Module Attributes
Corresponds to |
|
Sentinel value indicating that the remaining time or charge is unknown. |
Classes
Enumeration of device power states. |
|
Reports the power status of the host device, or whatever lies that libretro.py tells it to report. |
- class PowerState[source]¶
Bases:
IntEnumEnumeration of device power states.
Corresponds to the
RETRO_POWERSTATE_*constants inlibretro.h.>>> from libretro.api import PowerState >>> PowerState.CHARGING <PowerState.CHARGING: 2>
- UNKNOWN = 0¶
- DISCHARGING = 1¶
- CHARGING = 2¶
- CHARGED = 3¶
- PLUGGED_IN = 4¶
- __new__(value)¶
- classmethod value in self¶
Return True if value is in cls.
value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)
- classmethod self[name]¶
Return the member matching name.
- __init__()¶
- classmethod iter(self)¶
Return members in definition order.
- classmethod len(self)¶
Return the number of members (no aliases)
- class retro_device_power[source]¶
Bases:
StructureReports the power status of the host device, or whatever lies that libretro.py tells it to report.
Corresponds to
retro_device_powerinlibretro.h.- state¶
Current power state of the device.
- seconds¶
Estimated remaining battery time in seconds, or
NO_ESTIMATEif unknown.
- __init__(*args, **kwargs)¶
- classmethod __new__(*args, **kwargs)¶
- percent¶
Battery charge percentage (0-100), or
NO_ESTIMATEif unknown.
- __deepcopy__(_)[source]¶
Return a copy of this object. Intended for use with
copy.deepcopy().
- retro_power_state¶
Corresponds to
retro_power_stateinlibretro.h.
- NO_ESTIMATE = -1¶
Sentinel value indicating that the remaining time or charge is unknown.