Repository navigation
Send media playback position from Home Assistant to NSPanels - #409
Merged
tpanajott merged 1 commit intoOct 25, 2026
Merged
Conversation
jamesmulcahy
force-pushed
the
feat/media-player-position
branch
from
October 21, 2026 03:21
0a919d0 to
950085d
Compare
Collaborator
Home Assistant media players report media_position, media_duration and media_position_updated_at, which were ignored. They are now sent to the panels with the rest of the media player state. A position without a time it was taken at can not be advanced, so it is only sent together with a valid media_position_updated_at. The position and duration are cleared when Home Assistant stops reporting them, for example when playback stops or the player turns off. media_position_updated_at is parsed with date::parse from Howard Hinnant's date library, added as a header-only Conan dependency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamesmulcahy
force-pushed
the
feat/media-player-position
branch
from
October 25, 2026 14:52
950085d to
a90e7a9
Compare
Contributor
Author
|
@tpanajott Thanks for merging the sources change; I've re-based this now and it's just a single commit |
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.
Home Assistant media players report
media_position,media_durationandmedia_position_updated_at. The manager ignored these until now. This PR sends them to the NSPanels so the media player page can show its progress bar (p_pos).Builds on #410 (protobuf fields 20–23 of
NSPanelEntityState.MediaPlayer), which has merged.Protobuf (merged in #410)
has_media_position,media_position(seconds),media_position_updated_at(Unix seconds) andmedia_duration(seconds; 0 when unknown, for example on a live stream).Manager
HomeAssistantMediaPlayerreads the three attributes on every state change. A position is only sent along with a timestamp that parses, because a position can't be advanced without knowing when it was taken. The position and duration are cleared when Home Assistant stops reporting them, for example when the player stops or turns off.2026-10-17T01:59:45.666287+00:00) are parsed with Howard Hinnant'sdatelibrary, added as the header-only Conan packagedate/3.0.5. Fractional seconds are truncated.Not in this PR
p_posand advancing it while playing is in a separate firmware PR, stacked on the panel wall clock work.Testing
tests/media_player_test.cpp: the position and duration are sent; seeking sends the new position; a live stream has a position but no duration; a position without a valid timestamp isn't sent; the position is cleared when playback stops; timestamp parsing, including offsets, fractional seconds and malformed input.tests/media_player_recorded_states_test.cppchecks the position fields against states recorded from Home Assistant.devel.🤖 Generated with Claude Code