Skip to content

feat: add play_melody service for buzzer melodies - #76

Merged
g4bri3lDev merged 1 commit into
OpenDisplay:feat/clean-portfrom
davelee98:feat/play-melody
Jul 27, 2026
Merged

feat: add play_melody service for buzzer melodies#76
g4bri3lDev merged 1 commit into
OpenDisplay:feat/clean-portfrom
davelee98:feat/play-melody

Conversation

@davelee98

@davelee98 davelee98 commented Jul 25, 2026

Copy link
Copy Markdown

Add a new opendisplay.play_melody sibling service that plays a multi-note melody on a device's buzzer via BuzzerActivateConfig.melody(). activate_buzzer stays a single-tone service; its docs gain a pointer to the new service.

  • services.py: _valid_melody validator, SCHEMA_PLAY_MELODY, _async_play_melody handler (mirrors _async_activate_buzzer), and registration.
  • services.yaml / strings.json / translations/en.json: play_melody definition, field docs (grammar summary), and the invalid_melody exception, in lockstep.
  • tests/test_services.py: wire-byte, plumbing, guard, and schema tests.

No dependency bump needed: BuzzerActivateConfig.melody() already ships in the pinned py-opendisplay==7.14.0 (added in v7.13.0), so manifest.json is unchanged.

Rebased onto current feat/clean-port

This branch has been rebased onto the latest feat/clean-port (through #74). The base had since added the write_nfc service, which inserted its schema/handler/registration and translation blocks at the same spots as play_melody. Resolved by keeping both services side by sidewrite_nfc and play_melody now coexist across services.py, services.yaml, strings.json, and translations/en.json. The branch merges cleanly into feat/clean-port with no conflicts; the diff is purely additive (play_melody only).

@davelee98
davelee98 requested a review from g4bri3lDev as a code owner July 25, 2026 18:44
Add a new opendisplay.play_melody sibling service that plays a multi-note
melody on a device's buzzer via BuzzerActivateConfig.melody(). activate_buzzer
stays a single-tone service; its docs gain a pointer to the new service.

- services.py: _valid_melody validator, SCHEMA_PLAY_MELODY, _async_play_melody
  handler (mirrors _async_activate_buzzer), and registration.
- services.yaml / strings.json / translations/en.json: play_melody definition,
  field docs (grammar summary), and the invalid_melody exception, in lockstep.
- tests/test_services.py: wire-byte, plumbing, guard, and schema tests.

manifest.json pin bump deferred until the py-opendisplay release.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@g4bri3lDev
g4bri3lDev merged commit 7352f51 into OpenDisplay:feat/clean-port Jul 27, 2026
2 checks passed
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