Skip to content

Modified ManufacturerDataField to return a namedtuple if possible #116

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 2 commits into from
Jun 9, 2021

Conversation

alexwhittemore
Copy link
Contributor

I'm definitely not convinced this covers all cases, nor am I convinced it's non-breaking, so I'm interested in feedback (but it does work neatly in my case).

If a given Advertisement subclass is defined with multiple fields in a single ManufacturerDataField, the current class requires it to have an array of field_names, which heretofore are unused.

This PR 1) enforces that field_names must be formatted properly for a namedtuple (i.e. no spaces, probably plenty of other things) and 2) returns a MDFTuple instead of a regular tuple, with fields named as defined.

Mostly, I'm not sure when lines 285+ come into play, and whether they ought to be covered by the namedtuple modification.

@alexwhittemore
Copy link
Contributor Author

For linky goodness, this would fix #114

@kattni kattni requested a review from a team January 4, 2021 23:21
@jposada202020
Copy link
Contributor

@alexwhittemore Hello alex, do you have any test code, I could test the changes to move this forward but I would like to know what were your test conditions. Thanks :)

@jposada202020 jposada202020 added the needs retest Needs testing label May 13, 2021
@evaherrada evaherrada changed the base branch from master to main June 7, 2021 17:18
@jposada202020
Copy link
Contributor

@tannewt :) now that you are working on the BLE, what do you are your thoughts regarding this PR?

Thanks

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This looks good to me!

@jposada202020 jposada202020 merged commit ad4f2d3 into adafruit:main Jun 9, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 12, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.5.11 from 3.5.10:
  > Moved default branch to main
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#115 from Anton-2/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.9.1 from 1.9.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#74 from jposada202020/adding_new_example
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#73 from kattni/rotary-neopixel-example
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#71 from jposada202020/adding_new_guides

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1325 to 1.2.5 from 1.2.4:
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.10.3 from 1.10.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#38 from bjnhur/master
  > Redoing adafruit/Adafruit_CircuitPython_Wiznet5k#37

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.0.2 from 8.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#116 from alexwhittemore/master
  > Moved default branch to main
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.14.2 from 0.14.1:
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Simple_Text_Display#1 from jposada202020/testing_readthedocs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs retest Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants