Repository navigation
feat: publish configured devices to the Macro Deck battery catalog (SDK beta.17) - #26
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Moves to Macro Deck SDK 3.0.0-beta.17 and publishes every configured device to Macro Deck's new battery catalog (
IBatteryProvider), so the devices appear in the built-in Battery widget and get the host's own battery variables.release.ymlcli-versionpin go to3.0.0-beta.17, which the Store now requires as its minimum.BatteryIntegration.Batteries.cs: implementsIBatteryProviderand attachesHostBatteryPublisherto the context the host passes in.HostBatteryPublisher: runs once per poll via the newBatteryPollingService.Polledevent. It sends the whole device set in onePublishAsync, and only when it differs from the last set sent, because every call counts toward the plugin's shared callback throttle. A failed publish is retried on the next poll.BatterySlotgainsEntryId, whichDeviceEntryReaderfills in.RemoveAsync, so the host deletes its variables. A device that is stale, unreadable or no longer discovered is published withIsConnected = falseand keeps its last level.headphones, the system battery becomeslaptop, pen and VR headset becomeother. Our own widget keeps its icons.battery_<id>_*variables are unchanged. The host's variables come in addition to them and are not replacements.Checklist
dotnet buildanddotnet testpass locally (0 warnings, 303 tests).Device/hardware tested against (if applicable)
Not a device backend.