The initial_value configured on gpiozero LED class is OFF.
STARTUP value is applied afterwards.
This is an issue when restarting OctoPrint, because the pins are momentarily driven OFF.
I have a power supply controller connected to a GPIO pin that should be ON while OctoPrint is running, but I can't restart the server (for example after upgrading) because the power is cut after restart (it doesn't turn on again, it can only turn off).
I would like the LED to have an initial_value equal to startup value when the delay is 0.
On this matter, I have another suggestion: LED accepts active_high parameter, which can be set to not inverted, so that XORing with inverted can be avoided when reading or writing. I'll try to issue a PR
The
initial_valueconfigured on gpiozeroLEDclass is OFF.STARTUP value is applied afterwards.
This is an issue when restarting OctoPrint, because the pins are momentarily driven OFF.
I have a power supply controller connected to a GPIO pin that should be ON while OctoPrint is running, but I can't restart the server (for example after upgrading) because the power is cut after restart (it doesn't turn on again, it can only turn off).
I would like the
LEDto have aninitial_valueequal to startup value when thedelayis 0.On this matter, I have another suggestion:
LEDacceptsactive_highparameter, which can be set tonot inverted, so that XORing with inverted can be avoided when reading or writing. I'll try to issue a PR