Skip to content

feat: publish configured devices to the Macro Deck battery catalog (SDK beta.17) - #26

Merged
PyFlat-JR merged 1 commit into
mainfrom
feature/sdk-beta17-batteries
Oct 15, 2026
Merged

PyFlat-JR merged 1 commit into
mainfrom
feature/sdk-beta17-batteries

Conversation

@PyFlat-JR

@PyFlat-JR PyFlat-JR commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

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.

  • SDK bump: all Macro Deck packages and the release.yml cli-version pin go to 3.0.0-beta.17, which the Store now requires as its minimum.
  • BatteryIntegration.Batteries.cs: implements IBatteryProvider and attaches HostBatteryPublisher to the context the host passes in.
  • HostBatteryPublisher: runs once per poll via the new BatteryPollingService.Polled event. It sends the whole device set in one PublishAsync, 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.
  • Device id: the host device id is the config entry's GUID, not the slot id. The slot id follows the device name, so a rename would otherwise leave a dead device in the host. BatterySlot gains EntryId, which DeviceEntryReader fills in.
  • Lifecycle: a deleted entry gets RemoveAsync, so the host deletes its variables. A device that is stale, unreadable or no longer discovered is published with IsConnected = false and keeps its last level.
  • Kind mapping: headset and earbuds become headphones, the system battery becomes laptop, pen and VR headset become other. Our own widget keeps its icons.
  • Our variables: the plugin's battery_<id>_* variables are unchanged. The host's variables come in addition to them and are not replacements.

Checklist

  • I have read AGENTS.md and CONTRIBUTING.md.
  • dotnet build and dotnet test pass locally (0 warnings, 303 tests).
  • I updated README.md / AGENTS.md if this changes what they describe.
  • If this touches a device backend: I tested it against the real hardware (see below).

Device/hardware tested against (if applicable)

Not a device backend.

@PyFlat-JR PyFlat-JR self-assigned this Oct 15, 2026
@PyFlat-JR
PyFlat-JR marked this pull request as ready for review October 15, 2026 21:44
@PyFlat-JR
PyFlat-JR merged commit d4069c4 into main Oct 15, 2026
3 checks passed
@PyFlat-JR
PyFlat-JR deleted the feature/sdk-beta17-batteries branch October 15, 2026 21:45
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.

1 participant