Skip to content

Catch Negative Values During Checks #7

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 14, 2018
Merged

Conversation

sommersoft
Copy link
Collaborator

Fixes Issue #6.

Copy link
Contributor

@kattni kattni 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 doing this! I have couple of suggestions.

@@ -172,7 +172,7 @@ def blink_rate(self):

@blink_rate.setter
def blink_rate(self, rate):
if 0 < rate > 3:
if not 0 < rate > 3:
Copy link
Contributor

Choose a reason for hiding this comment

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

What are the acceptable values? Here, if rate is between 0 and 3, it will fail. So, are the acceptable rates all less than 0 and greater than 3?

Consider trying if not 0 <= rate <= 3:.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The acceptable range is 0 to 3. So yes, this would definitely fail that test. Update coming in a few!

@@ -188,7 +188,7 @@ def brightness(self):

@brightness.setter
def brightness(self, brightness):
if 0 < brightness > 15:
if not 0 < brightness > 15:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above. Is brightness always greater than 15?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Range is 0 to 15.

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

@kattni kattni merged commit cd73650 into adafruit:master Jun 14, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 9, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#3 from kattni/pypi
  > updated CoC

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#3 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#2 from sommersoft/new_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_Trellis to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#8 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#7 from sommersoft/val_checks
  > Merge pull request adafruit/Adafruit_CircuitPython_Trellis#5 from sommersoft/bytearray_fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.1.1 from 3.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#16 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#15 from caternuson/master
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#14 from sommersoft/new_docs
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#13 from caternuson/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2591 to 1.1.0 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2591#4 from kattni/pypi
  > updated CoC

Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 3.1.0 from 3.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#4 from kattni/pypi
  > updated CoC

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.9.0 from 0.8.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#4 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#3 from sommersoft/new_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6070 to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#4 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#3 from sommersoft/new_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.1.0 from 3.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#4 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#3 from sommersoft/new_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#4 from kattni/pypi
  > updated CoC
  > Merge pull request adafruit/Adafruit_CircuitPython_VL6180X#3 from sommersoft/new_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_WS2801 to 0.9.0 from 0.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_WS2801#2 from kattni/pypi
  > updated CoC
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