Repository navigation
feat(camera): add a sub-stream camera entity per channel - #42
Merged
Merged
Conversation
Each channel now gets a second camera entity bound to the DVR's sub stream (stream=1.sdp), disabled by default — the one-entity-per-stream layout Reolink, UniFi Protect and ONVIF use. It starts faster and uses less bandwidth than the full-resolution main stream. The main entity keeps its unique_id and its existing fallback to an H.264 sub stream when the main one is H.265. The sub entity probes only sub-stream URLs. h265_channels and stream_info are now keyed by (channel, stream); repairs dedupe channels and diagnostics list chN / chN_sub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #41
Summary
Answers the user question about using the sub stream for live view: each channel now has a dedicated sub-stream camera entity (disabled by default), following the same one-entity-per-stream pattern as Reolink (Fluent/Clear), UniFi Protect (High/Medium/Low) and ONVIF (one entity per profile).
XMEyeCamera(..., stream=1)per channel. Its unique_id is…_ch{n}_camera_sub, its translation key iscamera_sub("{title} Substream", translated in all 12 locales) andentity_registry_enabled_default=False.stream=1.sdp,/live/ch{n}_1,/h264/…/sub/…).coordinator.h265_channels/stream_infoare now keyed by(channel, stream). The H.265 repairs dedupe channels, and diagnostics listchN/chN_sub.Test plan
ruff check custom_components/python helpers/i18n.py --checkcamera.<device>_chN_substream. In diagnostics, checkchN_sub.stream_idx == 1and confirm the live view is low resolution.stream=0(H.264 main)./api/streams, and that disabling one does not drop the other.🤖 Generated with Claude Code