Add VGA/2K/4K resolution - #217
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #217 +/- ##
==========================================
+ Coverage 77.88% 79.19% +1.30%
==========================================
Files 11 11
Lines 1723 1735 +12
==========================================
+ Hits 1342 1374 +32
+ Misses 381 361 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request updates the SDK’s camera configuration surface to align with the underlying protocol by expanding supported camera resolutions (VGA/2K/4K) and adding streaming protocol access, along with tests to validate the new behavior.
Changes:
- Extend
Camera.resolutionto support 480 (VGA), 1440 (2K), and 2160 (4K) mappings in addition to existing values. - Add
Camera.streaming_protocolgetter/setter behavior and corresponding tests. - Add/expand unit tests for
resolutionandstreaming_protocolproperties.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
blueye/sdk/camera.py |
Extends resolution mapping and adds streaming protocol property logic. |
tests/test_camera.py |
Adds parametrized tests for new resolution values and streaming protocol getter/setter validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add 480 (VGA), 1440 (2K) and 2160 (4K) to the camera resolution property, using the enum members that actually exist in the protocol (RESOLUTION_VGA_480P, RESOLUTION_QHD_2K, RESOLUTION_UHD_4K). Add tests for the resolution mapping in both directions and for the existing streaming_protocol property, which was previously untested. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ddfa68d to
8ffcbaa
Compare
| self._update_camera_parameters() | ||
| if self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_HD_720P: | ||
| if self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_VGA_480P: | ||
| return 480 | ||
| elif self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_HD_720P: | ||
| return 720 | ||
| elif ( | ||
| self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_FULLHD_1080P | ||
| ): | ||
| return 1080 | ||
| elif self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_QHD_2K: | ||
| return 1440 | ||
| elif self._camera_parameters.resolution == blueye.protocol.Resolution.RESOLUTION_UHD_4K: | ||
| return 2160 | ||
|
|
Description
Add 480 (VGA), 1440 (2K) and 2160 (4K) to the camera resolution property, using the enum members that actually exist in the protocol (RESOLUTION_VGA_480P, RESOLUTION_QHD_2K, RESOLUTION_UHD_4K). Add tests for the resolution mapping in both directions and for the existing streaming_protocol property, which was previously untested.
Checklist before merging