Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery module. Gamepads support #1481

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Battery module. Gamepads support #1481

merged 2 commits into from
Mar 14, 2022

Conversation

LukashonakV
Copy link
Contributor

@LukashonakV LukashonakV commented Mar 14, 2022

Standard battery module doesn't support of the gamepads such as PS Dualshock are connected over bluetooth . Moreover this module crashes waybar in case when wrong battery info is provided in the json .config.
Current two commits bring next fixes:

  1. Do not propagate raised exception when physical device disappeared in the system. When wrong config or the gamepad was unplugged and device is removed from the /sys/classes the module just is set to invisible mode. Once device is back, module will print info just after provided delay.
  2. Gamepad devices are recognized in the linux such a power_supply class but with the limited information about devices. For example PS Dualshock provides the only capacity, status. For such devices module does not do capacity estimation and uses provided capacity by the gamepad controller as is.

Example:
ps_2022-03-14-18_38_37
.config
"battery#bat2": { "bat": "sony_controller_battery_1c:96:5a:87:26:1e", "states": {"warning": 30, "critical": 15}, "design-capacity": false, "interval": 60, "format": "{icon} {capacity}%", "format-icons": ["ﱉ","ﱊ","ﱌ","ﱍ","ﱋ"] }, "battery#bat3": { "bat": "sony_controller_battery_d0:27:88:32:fc:ee", "states": {"warning": 30, "critical": 15}, "design-capacity": false, "interval": 60, "format": "{icon} {capacity}%", "format-icons": ["ﱉ","ﱊ","ﱌ","ﱍ","ﱋ"] },

@Alexays
Copy link
Owner

Alexays commented Mar 14, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants