Skip to content

Feat/headsetcontrol provider - #45

Open
itayavra wants to merge 3 commits into
masterfrom
feat/headsetcontrol-provider
Open

itayavra wants to merge 3 commits into
masterfrom
feat/headsetcontrol-provider

Conversation

@itayavra

Copy link
Copy Markdown
Owner

No description provided.

- Introduced a new configuration group for HeadsetControl in main.xml.
- Updated UI components to include HeadsetControl options in Modules.qml.
- Added HeadsetControlProvider.qml to manage headset battery status via the headsetcontrol CLI tool.
- Implemented polling mechanism for battery status updates and device management.
…ails

- Added information about the new HeadsetControl provider for battery monitoring of various gaming headsets in the CHANGELOG.
- Updated the README to reflect the addition of HeadsetControl support, specifying the compatible headset models and the requirement for the `headsetcontrol` CLI tool.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Device identity, unknown charging levels, disabled refresh behavior, and expensive polling need correction.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds HeadsetControl-based gaming headset battery monitoring.

Changes:

  • Adds CLI polling and JSON device conversion.
  • Integrates provider settings and priority ordering.
  • Documents supported headsets and installation requirements.
File summaries
File Description
README.md Documents HeadsetControl support.
CHANGELOG.md Records the new integration.
contents/config/main.xml Adds provider configuration defaults.
contents/ui/config/Modules.qml Adds enable and polling controls.
contents/ui/main.qml Registers the provider.
contents/ui/providers/HeadsetControlProvider.qml Implements polling and device mapping.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

id: root
visible: false

readonly property string binaryCmd: "headsetcontrol -o json"
})
.map(d => ({
name: d.device || i18n("Unknown Headset"),
serial: "hc-" + d.id_vendor + ":" + d.id_product,
.map(d => ({
name: d.device || i18n("Unknown Headset"),
serial: "hc-" + d.id_vendor + ":" + d.id_product,
percentage: Math.max(0, d.battery.level || 0),
Comment on lines +43 to +46
function refresh() {
pollSource.disconnectSource(binaryCmd)
pollSource.connectSource(binaryCmd)
}
- Clarified that Logitech headsets are skipped in the HeadsetControl provider as they are handled by the HID provider.
- Updated README to reflect this change and provide clearer information on supported devices.
- Increased the default polling time for HeadsetControl from 5 to 30 seconds to improve performance.
- Improved error handling in the HeadsetControlProvider for better management of headset detection and binary availability.
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.

2 participants