Assume I want to create a class called “light_LED” such that:
Class light_LED(self, LED, rgb, brightness) <== this may not be correct, but it should do for the example.
LED = which LED to light
rgb = a tuple with the R, G, B) colors defined as colors in the range of 0-255
brightness = an intensity value in the range of 0-100.
I want “brightness” to be an optional parameter with a default value of “50” (50% brightness). And yes, I know that if I want the brightness to be visually linear, I have to gamma-correct it - but that’s a different problem.
The idea being that, (for example), if I want to create a new version of easygopigo3, (or something else), I can replace it in such a way that existing code won’t break, but new implementations can use the optional parameter to set the brightness of the LEDs.
So far, my research on-line does not say anything about optional class parameters. The only thing I can find are optional function parameters.