feat: add some extra commands - #6
Conversation
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds camera on/off and night-mode controls through MQTT and the high-level ChangesCamera control
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
harbor/events.py (1)
344-362: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not classify command acknowledgements as camera events.
Replies for
pause-stream,unpause-stream, andupdate-night-modereach this fallback and becomeCameraEventUpdates. Each command therefore adds a false entry tostate.eventsand emits a device update, including rejected commands. Return unmatched/responses/topics as raw events before the generic camera-event fallback.Proposed fix
+ if source_type == "camera" and "/responses/" in topic: + return RawEventUpdate(payload=raw_payload, **base_kwargs) + if source_type == "camera": active_seconds = extract_event_duration_seconds(raw_payload)Add a regression test parsing a control response and asserting it is not a
CameraEventUpdate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@harbor/events.py` around lines 344 - 362, Before the generic camera-event fallback in the camera handling flow, detect unmatched /responses/ topics and return them as raw events, including rejected command responses. Preserve existing motion_detection validation and normal camera-event handling, and add a regression test covering a control response that asserts it is not classified as CameraEventUpdate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@harbor/events.py`:
- Around line 344-362: Before the generic camera-event fallback in the camera
handling flow, detect unmatched /responses/ topics and return them as raw
events, including rejected command responses. Preserve existing motion_detection
validation and normal camera-event handling, and add a regression test covering
a control response that asserts it is not classified as CameraEventUpdate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 76595876-d7c1-400d-9915-cb63ef8e0e4e
📒 Files selected for processing (8)
harbor/__init__.pyharbor/core.pyharbor/devices/camera.pyharbor/events.pyharbor/mqtt.pytests/test_camera_state.pytests/test_core.pytests/test_mqtt.py
Summary by CodeRabbit
New Features
Bug Fixes