BluEye-Robotics / blueye.sdk

A Python package for remote control of Blueye underwater drones.
GNU Lesser General Public License v3.0
17 stars 4 forks source link

Dynamically list peripherals #143

Closed sindrehan closed 1 year ago

sindrehan commented 1 year ago

This PR adds a function that checks which peripherals are attached to the connected drone, and stores them in a list on the Drone object.

Example:

from blueye.sdk import Drone

x3 = Drone()  # A drone with external lights and camera
x3.peripherals[0].set_intensity(0.5) # Setting external lights to 50%
x3.peripherals[1].is_recording = True # Starts the recording on the external camera

# The following also works for external lights and cameras
x3.external_light.set_intensity(0)
x3.external_camera.is_recording = False
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 83.82% and project coverage change: +0.75% :tada:

Comparison is base (07013a5) 71.78% compared to head (2dffdf3) 72.53%.

:exclamation: Current head 2dffdf3 differs from pull request most recent head d43e024. Consider uploading reports for the commit d43e024 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #143 +/- ## ========================================== + Coverage 71.78% 72.53% +0.75% ========================================== Files 10 11 +1 Lines 1095 1158 +63 ========================================== + Hits 786 840 +54 - Misses 309 318 +9 ``` | [Flag](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | Coverage Δ | | |---|---|---| | [macos-latest_3.10](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.53% <83.82%> (+0.75%)` | :arrow_up: | | [macos-latest_3.11](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.53% <83.82%> (+0.75%)` | :arrow_up: | | [macos-latest_3.8](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.58%> (+0.73%)` | :arrow_up: | | [macos-latest_3.9](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.58%> (+0.73%)` | :arrow_up: | | [ubuntu-latest_3.10](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.53% <83.82%> (+0.75%)` | :arrow_up: | | [ubuntu-latest_3.11](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.53% <83.82%> (+0.75%)` | :arrow_up: | | [ubuntu-latest_3.8](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.58%> (+0.73%)` | :arrow_up: | | [ubuntu-latest_3.9](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.58%> (+0.73%)` | :arrow_up: | | [windows-latest_3.10](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.82%> (+0.76%)` | :arrow_up: | | [windows-latest_3.11](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.51% <83.82%> (+0.76%)` | :arrow_up: | | [windows-latest_3.8](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.49% <83.58%> (+0.73%)` | :arrow_up: | | [windows-latest_3.9](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | `72.49% <83.58%> (+0.73%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics) | Coverage Δ | | |---|---|---| | [blueye/sdk/connection.py](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics#diff-Ymx1ZXllL3Nkay9jb25uZWN0aW9uLnB5) | `51.25% <75.00%> (-0.03%)` | :arrow_down: | | [blueye/sdk/drone.py](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics#diff-Ymx1ZXllL3Nkay9kcm9uZS5weQ==) | `76.74% <85.00%> (+1.74%)` | :arrow_up: | | [blueye/sdk/guestport.py](https://app.codecov.io/gh/BluEye-Robotics/blueye.sdk/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BluEye-Robotics#diff-Ymx1ZXllL3Nkay9ndWVzdHBvcnQucHk=) | `85.00% <85.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sindrehan commented 1 year ago

I don't have an external light at the home office, so would be great if you could give it a test @alexagv