Repository navigation
Send per-event buzzer sounds to panels in NSPanelConfig - #394
Conversation
Add a repeated Sound field to NSPanelConfig that maps panel events (TOUCH, SCENE_ACTIVATED, SCENE_SAVED) to RTTTL melodies, for the panel buzzer support added to the firmware in NSPanelManager-firmware#29. The sounds come from three new global settings, buzzer_sound_touch, buzzer_sound_scene_activated and buzzer_sound_scene_saved, which a panel setting with the same name overrides. They default to empty, which sends no entry and leaves the event silent, so panels behave as before until a sound is configured. There is no UI for them yet; set them through POST /rest/settings. Generated with protoc 27.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
000e11d to
f33639e
Compare
Covers a panel with no buzzer settings, the global sound for each event, and panel settings overriding the global ones, including an empty panel setting silencing an event that has a global sound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I've tested this end-to-end with the matching NSPanelManager-firmware PR and can confirm it works end-to-end. If we can get both pieces merged, I'll followup with a UI change to allow users to customize the sounds |
tpanajott
left a comment
There was a problem hiding this comment.
This looks pretty good but If we have this sort of functionality it would perhaps be smart to have functionality to, at least over MQTT (ie. from Home Assistant or OpenHAB) be able to put the panel in a "quite mode" for night time. I'm thinking of a user having this on and then needing to get up at night and waking up the wife because the panel beeps. I'm thinking this can be a toggle just as the relay state or such.
|
@tpanajott Are you thinking that the toggle would be triggered externally, or that we'd include functionality for managing the time periods where it's disabled? Could we merge the baseline functionality as is, and build this on top? As is, no panels will start playing sounds when this is merged, you'd have to call the API and set sounds up first. |
|
Yeah, externally controlled simply by a toggle. I'll merge this as is. |
NSPManager#394 added the Sound message and NSPanelConfig.sounds to protobuf_nspanel.proto but did not regenerate the protobuf-c code the firmware builds against. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds per-event buzzer sounds to
NSPanelConfig, so the manager can tell panels what to play for touches, scene activation and scene saves. This is the manager side of the panel buzzer support merged in NSPManager/NSPanelManager-firmware#29. The firmware side that uses it is NSPManager/NSPanelManager-firmware#38.Changes
NSPanelSoundEventenum (TOUCH,SCENE_ACTIVATED,SCENE_SAVED) andrepeated Sound sounds = 45(event → RTTTL string) toNSPanelConfig.buzzer_sound_touch,buzzer_sound_scene_activatedandbuzzer_sound_scene_saved. All default to empty. A per-panel setting with the same name overrides the global one.NSPanel::send_config(): adds onesoundsentry for each non-empty setting.Behaviour
An empty setting sends no entry, and the event is silent. Panels therefore sound exactly as they do today until someone sets a sound. Older firmware ignores the new field.
Not in this PR
There is no UI for the settings yet, because the UI is changing. Until there is, set them through the REST API, which also triggers a reload:
Generated code
protobuf_nspanel.pb.{cc,h}were regenerated with protoc 27.0. Before applying the proto change, I confirmed it reproduces the checked-in files byte for byte, so the diff contains only this change.Testing
nspanel.cppand the regeneratedprotobuf_nspanel.pb.ccpass a syntax-only compile (gcc 15, C++23)--test:NSPanelTest.*passes, including three new tests intests/nspanel_test.cpp(no sounds without settings, global sounds sent per event, per-panel settings override global ones)🤖 Generated with Claude Code