-
Notifications
You must be signed in to change notification settings - Fork 53
Made members that store sensor data properties. Removed deprecated members. disabled members return none #38
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
Conversation
Alright. Just tested this and everything seems to be working fine |
"""Gives the raw accelerometer readings, in m/s.""" | ||
if self.mode not in [0, 2, 3, 6]: | ||
return self._acceleration | ||
return (None, None, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also update the docstrings of the mode property and the new properties that may return None
to describe the new behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't change anything in the mode property, so I'm not really sure what I'd change on that docstring, but I'll do the docstrings for the new properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstrings in the individual properties are great. All I would do for the mode property is to add a legend at the top of the table to describe what each symbol in the table means (x=on, -=off and will return an empty tuple)
adafruit_bno055.py
Outdated
@property | ||
def acceleration(self): | ||
"""Gives the raw accelerometer readings, in m/s.""" | ||
if self.mode not in [0, 2, 3, 6]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would use the _MODE
consts to make it more clear when and why the decision to return None
is being made
@siddacious Does this look good? I wasn't really sure what to do about the mode property's docstring. |
So close! Just fix the whitespace issue that pylint is complaining about and we're good to go |
Oops. Too late. FWIW - the lists could've been tuples. Ex: if self.mode not in (0, 2, 3, 6): |
I’ll make sure to change that before I make the next release for this library |
Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 4.0.0 from 3.1.2: > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#38 from dherrada/master Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.4.2 from 2.4.1: > Merge pull request adafruit/Adafruit_CircuitPython_EPD#31 from makermelissa/master > Merge pull request adafruit/Adafruit_CircuitPython_EPD#28 from ladyada/master > Merge pull request adafruit/Adafruit_CircuitPython_EPD#27 from ladyada/master
It's really late, and I haven't tested everything about this, but I don't anticipate anything major about the structure of the code changing if I find a little bug or two when I'm testing it. Fixes #37