Closed riverajo closed 10 years ago
I looked at the change and the input is checked if it's in a list of valid colors, but then you simply return. I would suggest that you raise an exception to indicate to a user of this method that something wrong happened. I suggest ValueError
https://docs.python.org/2/library/exceptions.html#exceptions.ValueError
There is no input validation in
Relay
classturn_on_only
method. I would imagine that this is dangerous as the input is an int corresponding to a pin on the GPIO board. This could leave you open to accidentally setting any pin to GPIO.LOW.