Fix Xiaomi Smart Doorbell 4 Pro dual-camera events - #2901
Open
wmgylc wants to merge 1 commit into
Open
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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
midr.cateye.sd40010on the existing downward-facing doorbell camera entity0as a separate main-camera entityRoot cause
The Xiaomi Smart Doorbell 4 Pro returns paired entries in
thirdPartPlayUnits: channel0is the main camera and channel10is the downward-facing camera. The integration previously consumed only the first event, which is why only the downward-facing view was exposed.Implementation
The event-list helper can now optionally retain the latest event for each channel while preserving its existing return value and default behavior. The model-specific camera path consumes that channel map, keeps channel
10on the current entity, and creates oneBaseSubEntitycamera for channel0.The change is scoped to
midr.cateye.sd400; all other camera models continue using the existing first-event behavior. Event dictionaries are copied before normalization so the cloud response is not mutated.中文说明
本 PR 修复米家智能可视门铃 4 Pro(
midr.cateye.sd400)在 Home Assistant 中只能看到下视摄像头的问题。该设备的云端事件会同时返回两个通道:0为主摄像头,10为下视摄像头;修改后会分别显示为两个摄像头实体,并已在真实设备上验证快照及 MJPEG 动态画面。Validation
python -m pytest -q tests/test_camera_channels.py— 1 passedgit diff --check200 image/jpeg200 multipart/x-mixed-replaceTested on hardware with:
midr.cateye.sd400Fixes #2675