Skip to content

set_motion_detection docstring and argument name #23

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

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

FoamyGuy
Copy link
Contributor

@FoamyGuy FoamyGuy commented Apr 4, 2022

Changing the name of this argument to be more descriptive and adding docstring syntax to make it appear nice in docs pages. Also more specifically suggest boolean for type instead of 0 and 1.

I didn't know these were this interchangeable but tested like this and it appears either should work the same:

>>> bytes([0x01, True])
b'\x01\x01'
>>> bytes([0x01, False])
b'\x01\x00'
>>> bytes([0x01, 0])
b'\x01\x00'
>>> bytes([0x01, 1])
b'\x01\x01'

@FoamyGuy FoamyGuy requested a review from tekktrik April 4, 2022 17:04
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

Thanks for this! Yeah, I actually think True and False are instances of int which is suuuuuper nice for things like this!

This is technically breaking. To that end, that could almost become a property with a getter and setter for motion_detect. Not sure why a method was chosen, but I also don't know the device that well, so maybe it makes more sense in practice?

@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Apr 4, 2022

I will bump the major version and explain the breaking change to argument name in release notes.

I do agree it could be made a property, which may be more inline with the code style guidelines (though I'd have to double check). IIRC this was contributed by a community member so they may have just gone with functions if that is what they were familiar / comfortable with.

@FoamyGuy FoamyGuy merged commit c13715b into adafruit:main Apr 4, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 5, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_74HC595 to 1.3.5 from 1.3.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx to 1.2.13 from 1.2.12:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.6.11 from 2.6.10:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 5.0.5 from 5.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_CLUE to 3.0.5 from 3.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 1.5.3 from 1.5.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.6.4 from 0.6.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.4.1 from 1.4.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.1.4 from 4.1.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.3.0 from 3.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#50 from tekktrik/dev/use-bus-device
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.4.3 from 4.4.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX7219 to 1.5.3 from 1.5.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX7219#42 from tekktrik/doc/update-example-pins

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 to 1.2.4 from 1.2.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 3.3.12 from 3.3.11:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 2.0.10 from 2.0.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#31 from tekktrik/doc/add-typing
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD4X to 1.3.1 from 1.3.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLA202X to 1.0.6 from 1.0.5:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSC2007 to 1.0.1 from 1.0.0:
  > "Reformatted per new black version"

Updating https://github.com/adafruit/Adafruit_CircuitPython_TT21100 to 0.8.1 from 0.8.0:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Corrected pylint version

Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 5.0.0 from 4.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#23 from FoamyGuy/doc_strings
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#22 from Neradoc/fix-documentation

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.6.1 from 3.6.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X to 1.1.0 from 1.0.2:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L1X#3 from wrdaigle/main
  > Fixed readthedocs build

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.4.3 from 1.4.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.2.4 from 8.2.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet to 0.12.2 from 0.12.1:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Colorsys to 2.0.5 from 2.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Dash_Dis to 1.1.4 from 1.1.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.7 from 1.1.6:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Post-patch cleanup pt2
  > Post-patch cleanup
  > Consolidate Documentation sections of README
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_Ducky to 1.0.4 from 1.0.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.15 from 2.5.14:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 2.1.1 from 2.1.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniesptool to 0.2.12 from 0.2.11:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniQR to 1.3.9 from 1.3.8:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.6.3 from 0.6.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.11.5 from 1.11.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#69 from tekktrik/dev/fix-doc-building
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.6.4 from 3.6.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.11.2 from 1.11.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#107 from tekktrik/doc/rerun-black
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.7.5 from 1.7.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Waveform to 1.3.11 from 1.3.10:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README
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