mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-24 23:55:52 +03:00
[PR #84] [MERGED] [Linux] Add Battery Class and Fix Battery Level Assignment #269
Labels
No labels
android
bug
documentation
enhancement
good first issue
help wanted
linux
pull-request
reverse-engineering
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librepods#269
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kavishdevar/librepods/pull/84
Author: @tim-gromeyer
Created: 3/25/2025
Status: ✅ Merged
Merged: 3/26/2025
Merged by: @kavishdevar
Base:
main← Head:linux-battery-class📝 Commits (2)
a6dbbd4Simple code cleanup5396041Add battery class📊 Changes
4 files changed (+167 additions, -26 deletions)
View changed files
📝
linux/CMakeLists.txt(+1 -0)📝
linux/airpods_packets.h(+19 -0)➕
linux/battery.hpp(+127 -0)📝
linux/main.cpp(+20 -26)📄 Description
This PR addresses an issue where the battery levels for the left and right AirPods were sometimes incorrectly switched. The problem stemmed from a hardcoded assumption in the previous code: it assumed the left AirPod was always the first in the data, when in fact, the primary AirPod (which could be either left or right) is reported first. This led to misassigned levels when the primary AirPod didn’t align with the hardcoded order. The new Battery class resolves this by dynamically identifying the components based on the actual data provided, eliminating the switching issue.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.