Skip to content

Add CTronics camera adapter - #404

Open
romainantes wants to merge 20 commits into
developfrom
feat/ctronics-new-adapter-fix
Open

Add CTronics camera adapter#404
romainantes wants to merge 20 commits into
developfrom
feat/ctronics-new-adapter-fix

Conversation

@romainantes

@romainantes romainantes commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Adds support for CTronics cameras using HTTP snapshots and ONVIF PTZ/Imaging controls.
It also extends RTSP stream path customization and adds dedicated documentation for camera adapters.

⚠️ Branch "docs/camera-adapter-guide" must be merged before this branch.

Changes:
New Adapter:

  • Introduced CTronicsCamera supporting authenticated HTTP snapshots, ONVIF PTZ, CGI relative focus, and ONVIF Imaging.
  • Registry & Config: Registered the ctronics adapter in registry.py and updated core/config.py to allow custom rtsp_path overrides.
  • Dependencies: Added onvif-zeep dependency to pyproject.toml and requirements.txt.
  • Documentation: Updated README.md and camera/adapters/README.md to document adapter responsibilities and configuration details.
  • Tests: Added unit and real-hardware integration tests in test_ctronics.py.

@romainantes
romainantes requested a review from fe51 August 18, 2026 10:24
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.83%. Comparing base (683bd48) to head (33edfcf).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #404   +/-   ##
========================================
  Coverage    78.83%   78.83%           
========================================
  Files            6        6           
  Lines          841      841           
========================================
  Hits           663      663           
  Misses         178      178           
Flag Coverage Δ
unittests 78.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MateoLostanlen MateoLostanlen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the CTronics adapter. 8 correctness issues, 1 dead code block, 1 efficiency note. Details inline.

Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py
Comment thread pyro_camera_api/pyro_camera_api/camera/registry.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/core/config.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
Comment thread pyro_camera_api/pyro_camera_api/camera/adapters/ctronics.py Outdated
@MateoLostanlen

Copy link
Copy Markdown
Member

Hi @romainantes,

Thanks a lot for the PR, and sorry for the late review! I left a few inline comments. I don't have access to the camera so it's not ideal for reviewing, but let me know what you think.

Quick question by the way: why go through ONVIF rather than the camera's native API? I've heard ONVIF is often less well maintained on the firmware side.

And following on from that, if it's pure ONVIF, I'm wondering if we should have a generic ONVIF adapter directly (reusable for other brands) rather than a CTronics-specific one. What do you think?

@romainantes

Copy link
Copy Markdown
Collaborator Author

Hi @romainantes,

Thanks a lot for the PR, and sorry for the late review! I left a few inline comments. I don't have access to the camera so it's not ideal for reviewing, but let me know what you think.

Quick question by the way: why go through ONVIF rather than the camera's native API? I've heard ONVIF is often less well maintained on the firmware side.

And following on from that, if it's pure ONVIF, I'm wondering if we should have a generic ONVIF adapter directly (reusable for other brands) rather than a CTronics-specific one. What do you think?

Thanks for the review and for raising this!

I chose ONVIF because the camera’s native API did not expose a sufficiently complete and reliable interface for all the operations required by the adapter. In particular, I had difficulty covering PTZ presets, absolute focus, focus status, and the different control paths consistently through the native API. ONVIF provided a single control interface for these operations, and I validated the relevant absolute-focus behavior on the available CTronics camera hardware.

That said, I am aware that ONVIF support can vary between firmware versions and vendors. The adapter therefore still handles several CTronics-specific details, such as snapshot capture, connection defaults, profile selection, preset-token behavior, and the camera’s advertised Imaging/PTZ capabilities.

I agree that a generic ONVIF adapter could be valuable in the future, especially for the PTZ and Imaging functionality. However, I would prefer to keep this PR CTronics-specific for now because the current implementation still contains vendor-specific behavior and has only been validated on CTronics hardware.

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