Add media player entity to NSPanel protobufs - #384
Draft
jamesmulcahy wants to merge 1 commit into
Draft
jamesmulcahy wants to merge 1 commit into
jamesmulcahy wants to merge 1 commit into
Conversation
Add a MediaPlayer entity state (playback state, title, artist, volume, mute, optional source volume and capability flags), a MediaPlayerCommand for panel to manager control, and ENTITY_TYPE_MEDIA_PLAYER for entity page slots. Also add the REBOOTING panel state that the firmware protobuf already carries, so regenerated firmware files keep it. Generated with protoc 27.0 and protoc-gen-c 1.4.1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u
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
I've been running media player support on my own NSPanels for several months. That includes Home Assistant media players on room entity pages and a control page on the panel. It started as a local hack with a side-channel MQTT topic and JSON payloads. I'm now unwinding those local changes and upstreaming them properly, in small steps, using the existing protobuf/entity patterns instead of the side channel.
This first PR only changes the manager ↔ panel interface. Nothing produces or consumes these messages yet, and every change is additive, so existing panels and managers are unaffected.
Changes
NSPanelEntityState.MediaPlayer: new entity state published on the entity'smqtt_state_topic.has_source_volumeis set). The panel only sees a volume value. Working out which Home Assistant entity that maps to stays in the manager.NSPanelMQTTManagerCommand.MediaPlayerCommand: panel → manager commands.has_*flag, following the pattern already used with protobuf-c.EntitySlot.EntityType.ENTITY_TYPE_MEDIA_PLAYER: lets the panel tell a media player slot from a toggleable one. Tapping it should open the control page instead of sending a toggle.NSPanelStatusReport.state.REBOOTING = 5: the firmware repo's protobuf files already have this (it comes fromfeat_first_page_react, which defines it identically), but the.protoondeveldoesn't. Adding it here keeps the firmware files regenerated from this PR in sync.Generated code was built with protoc 27.0 and protoc-gen-c 1.4.1, matching the files already on
devel. Running those tools on the unmodified.protofiles reproduces the committed generated files exactly, so the generated diff only contains the changes above.Follow-ups
none,player_attributesorsource_entity).I'm opening this as a draft to get early feedback on the message design before the follow-ups build on it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X7aYyRjzk53Sd7gxF46E3u