Skip to content

Initial value should reflect the startup value (when no delay) #354

@cesaregiannetti

Description

@cesaregiannetti

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions