Repository navigation
Add a button mode that opens the room's first media player - #425
Draft
jamesmulcahy wants to merge 3 commits into
Draft
jamesmulcahy wants to merge 3 commits into
jamesmulcahy wants to merge 3 commits into
Conversation
OPEN_ENTITY_PAGE tells the panel to open the entity page for buttonN_entity_page_topic when the button is pressed, without a round trip to the manager. The relay is left alone. Older firmware that receives mode 5 logs "Unknown button action" and does nothing; newer firmware paired with an older manager never receives it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A button in OPEN_MEDIA_PLAYER mode (stored value 6) is sent to the panel as OPEN_ENTITY_PAGE with the state topic of the first media player in the panel's room, in the order the entities page shows them. The panel opens the page itself, with no round trip to the manager. If the room has no media player, the button is sent as NOTIFY_MANAGER, so the relay is left alone and a press is only logged. The topic follows the room's entities: every change to them reloads the manager, which resends each panel's config. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… mode The mode has no settings of its own. Saving it clears the detached entity and the custom MQTT settings, as for any mode other than those. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
Draft
This branch has not been deployed
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.
Summary
This PR adds a button mode that opens the room's first media player. Pressing the panel's physical button opens the media player page for the first media player in the panel's room.
Stacked on #423 (the protobuf change). Until that merges, its commit also shows here. Review the last two commits.
Behaviour
buttonN_mode = 6. It's appended toButtonMode, because the value is stored in the database.OPEN_ENTITY_PAGE, with that player's state topic. The panel opens the page itself, with no round trip to the manager.NOTIFY_MANAGER, so the relay is left alone, and the manager logs a warning. A press is only logged.Keeping the topic current
The config is rebuilt whenever the room's media players change. Every REST view that adds, edits, moves or deletes an entity, or creates, deletes or reorders an entities page, already calls
send_mqttmanager_reload_command(). That reload runsEntityManager::load_entities(), which resends each panel's config after rooms and entities have reloaded. The config is retained, so a panel that was offline gets it on reconnect. No new code was needed for this.Web UI
The new mode is one
<option>per button inedit_nspanel.html. It has no settings of its own, soviews.pyandedit_nspanel.jsalready handle it: saving it clears the detached entity and the custom MQTT settings. There's no migration.Tests
nspanel_test.cpp, all 51NSPanelTestpass):test_panels.py): the mode saves for both buttons, clears the detached entity, reloads the manager, and the edit page shows it selected.Also run end to end with the matching firmware against the dev stack (#421) and a QEMU-emulated panel. A press from the screensaver opens the media player page without touching the relay or messaging the manager, a room with no player falls back, and deleting the player resends the fallback config.
🤖 Generated with Claude Code