Skip to content

update some models and commands - #7

Merged
Lash-L merged 1 commit into
mainfrom
command_sync
Jul 26, 2026
Merged

update some models and commands#7
Lash-L merged 1 commit into
mainfrom
command_sync

Conversation

@Lash-L

@Lash-L Lash-L commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Adds some more controls and fixes night mode settings!

Summary by CodeRabbit

  • New Features

    • Added camera controls for night mode, temperature scale, video flip, and clock display.
    • Added support for updating multiple camera preferences in one request.
    • Improved camera state reporting, including preference values, runtime night mode, and volume details.
    • Added clearer command errors with status and field-level validation details.
  • Documentation

    • Expanded camera control guidance, validation rules, error handling, and firmware compatibility information.
  • Bug Fixes

    • Improved handling of unsupported commands, unexpected setting values, and partial camera updates.

@Lash-L
Lash-L requested a review from afgarcia86 July 26, 2026 18:01
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Lash-L, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 603c1463-074a-4151-a808-6b707f69831b

📥 Commits

Reviewing files that changed from the base of the PR and between 238b533 and d7e1a06.

📒 Files selected for processing (10)
  • README.md
  • harbor/__init__.py
  • harbor/core.py
  • harbor/data/mqtt_models.py
  • harbor/devices/camera.py
  • harbor/exceptions.py
  • harbor/mqtt.py
  • tests/test_camera_state.py
  • tests/test_core.py
  • tests/test_mqtt.py
📝 Walkthrough

Walkthrough

The PR adds typed camera preference controls, a generalized MQTT update-settings command, expanded camera state mapping, structured command errors, public exports, documentation, and tests for validation, payloads, response matching, and firmware failures.

Changes

Camera settings contracts and public APIs

Layer / File(s) Summary
Public APIs and settings contracts
harbor/core.py, harbor/mqtt.py, harbor/data/mqtt_models.py, harbor/__init__.py, tests/test_core.py, README.md
Adds typed Harbor camera setters, the UpdateCameraSettingsRequest payload, expanded settings models and exports, delegation tests, and camera-control documentation.

Camera state normalization

Layer / File(s) Summary
Camera settings state normalization
harbor/devices/camera.py, tests/test_camera_state.py
Maps writable preferences and runtime values into separate state keys, preserves boolean state across partial responses, preserves valid casing, and maps unknown choices to "unknown".

MQTT command flow and errors

Layer / File(s) Summary
MQTT command validation and errors
harbor/mqtt.py, harbor/exceptions.py, tests/test_mqtt.py
Validates preference inputs, publishes update-settings payloads, matches responses by sequence, refreshes settings, and exposes parsed command and unsupported-command errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Harbor
  participant HarborMQTTClient
  participant CameraFirmware
  Harbor->>HarborMQTTClient: Set camera preference
  HarborMQTTClient->>CameraFirmware: Publish update-settings request
  CameraFirmware-->>HarborMQTTClient: Return seq and status
  HarborMQTTClient->>HarborMQTTClient: Validate response and refresh settings
  HarborMQTTClient-->>Harbor: Complete or raise command error
Loading

Possibly related PRs

Suggested reviewers: afgarcia86

Poem

A rabbit taps settings bright,
“Auto, on, or off” feels right.
MQTT hops through the air,
Errors now have names to share.
State stays neat from day to night.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague and generic to convey the main change in the pull request. Use a concise, specific title that mentions the added camera settings commands and night mode/model updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 94.12% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch command_sync

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Replace the non-existent update-night-mode command with update-settings,
add video flip, clock display and temperature scale controls, and
distinguish unsupported commands from rejected ones.
@Lash-L
Lash-L merged commit f923e68 into main Jul 26, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants