Skip to content

Add battery level support #38

Description

@whirvis

An I/O feature representing the battery level of a device should be added when possible to the controller module. The class of the I/O feature may possibly be named Battery or InternalBattery, and its state class BatteryLevel. The state class shall have a method named getLevel(), which returns a floating point value from 0.0 for an empty battery and 1.0 for a fully charged battery. It shall also have a method called getPercentage(), which calls getLevel() and converts its value to an integer with a range from 0 to 100.

Device classes which may have a battery feature could be, but are not limited to: XboxController, Ps3Controller, Ps4Controller, Ps5Controller, Wiimote, NxLeftJoyCon, NxRightJoyCon, and NxProController.

UPDATE: The xinput module now supports the INTERNAL_BATTERY feature present in XboxController.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmodule-deviceIssue relates to the device modulesmodule-hid-usbIssue relates to the HID & USB modulesmodule-xinputIssue relates to the X-input module

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions