Skip to content

feat: add notification sounds, Pixlet schema support, and programmatic triggers - #936

Draft
brombomb wants to merge 13 commits into
tronbyt:mainfrom
brombomb:feat/notification-sounds
Draft

brombomb wants to merge 13 commits into
tronbyt:mainfrom
brombomb:feat/notification-sounds

Conversation

@brombomb

@brombomb brombomb commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds end-to-end notification sound support:

  • Audio Hardware Capability: Models none, piezo, and full hardware audio capabilities for devices.
  • Pixlet Sound Schema Support: Discovers and extracts sounds declared via schema.Sound and schema.Notification in Starlark apps.
  • Option A Smart Fallback for Piezo (Tidbyt Gen 2): Automatically maps app sound names to buzzer tone keywords (ding, chime, bell, alert, pop) with a pleasant 2-tone chime fallback (659:120,880:180).
  • Unified Sound Routes: Serves app sounds, custom uploads, and built-in sounds via GET /sounds/{appId}/{filename} and GET /api/sounds/{filename} with strict path traversal protection.
  • Simultaneous Push & Sound: Added optional sound parameter to POST /v0/devices/{id}/push_app and POST /v0/devices/{id}/push (ideal for real-time events like sports score notifications).
  • Programmatic Sound API: Enhanced POST /v0/devices/{id}/sound to accept app_id and stream URLs.
  • Admin Sound Management: Upload, preview, and delete custom audio files in Settings > Notification Sounds.

Testing

  • Added comprehensive unit tests in sounds_test.go covering payload resolution, Option A piezo fallbacks, schema extraction, push integration, and unified route serving.
  • All server unit tests passing (go test ./internal/server/...).

…nd programmatic sound triggers

- Add hardware audio capability modeling (none, piezo, full) to devices
- Support native Pixlet sound discovery (schema.Sound and schema.Notification)
- Add Option A smart fallback for piezo devices (keyword tone mapping and pleasant 2-tone chime)
- Implement unified sound routes GET /sounds/{appId}/{filename} and GET /api/sounds/{filename}
- Support admin custom sound management (upload, delete, preview)
- Add sound trigger parameters to POST /v0/devices/{id}/sound, push_app, and push
- Support sound playback trigger on render (on_change or every_render) with SHA-256 change detection
- Include comprehensive unit tests and documentation in API.md
@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

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