Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically list peripherals #143

Merged
merged 8 commits into from
Sep 22, 2023
Merged

Conversation

sindrehan
Copy link
Member

@sindrehan sindrehan commented Aug 21, 2023

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

@sindrehan sindrehan added the enhancement New feature or request label Aug 21, 2023
@sindrehan sindrehan added this to the v2.0 milestone Aug 21, 2023
@sindrehan sindrehan self-assigned this Aug 21, 2023
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

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

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

❗ 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
@@            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 Coverage Δ
macos-latest_3.10 72.53% <83.82%> (+0.75%) ⬆️
macos-latest_3.11 72.53% <83.82%> (+0.75%) ⬆️
macos-latest_3.8 72.51% <83.58%> (+0.73%) ⬆️
macos-latest_3.9 72.51% <83.58%> (+0.73%) ⬆️
ubuntu-latest_3.10 72.53% <83.82%> (+0.75%) ⬆️
ubuntu-latest_3.11 72.53% <83.82%> (+0.75%) ⬆️
ubuntu-latest_3.8 72.51% <83.58%> (+0.73%) ⬆️
ubuntu-latest_3.9 72.51% <83.58%> (+0.73%) ⬆️
windows-latest_3.10 72.51% <83.82%> (+0.76%) ⬆️
windows-latest_3.11 72.51% <83.82%> (+0.76%) ⬆️
windows-latest_3.8 72.49% <83.58%> (+0.73%) ⬆️
windows-latest_3.9 72.49% <83.58%> (+0.73%) ⬆️

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

Files Changed Coverage Δ
blueye/sdk/connection.py 51.25% <75.00%> (-0.03%) ⬇️
blueye/sdk/drone.py 76.74% <85.00%> (+1.74%) ⬆️
blueye/sdk/guestport.py 85.00% <85.00%> (ø)

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

@sindrehan sindrehan force-pushed the dynamically-list-peripherals branch 2 times, most recently from 95921e0 to 44ca21b Compare September 21, 2023 18:25
@sindrehan sindrehan marked this pull request as ready for review September 21, 2023 19:09
@sindrehan
Copy link
Member Author

sindrehan commented Sep 21, 2023

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

@sindrehan sindrehan mentioned this pull request Sep 21, 2023
Copy link
Contributor

@alexagv alexagv left a comment

Choose a reason for hiding this comment

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

Tested and it works 👍🏻

@sindrehan sindrehan merged commit 72acc5a into master Sep 22, 2023
15 checks passed
@sindrehan sindrehan deleted the dynamically-list-peripherals branch September 22, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants