Closed strix-technica closed 2 years ago
Killing the daemon requires a SIGKILL which doesn't switch off LEDs on termination. If anybody cares about this, I'll add a suitable signal handler.
SIGTERM now gracefully handled.
Nice! Thanks for taking the time to make a PR. I'll test/merge as soon as I can.
You're welcome, @Gadgetoid, glad it's of interest! I've just pushed some improvements to daemon mode making it behave a bit better, notably on SIGTERM.
I've also added support for multiple topics and an optional timeout mechanism such that a pixel that hasn't received a message in a defined time will be turned off. This is intended to signal failure of whatever was sending messages.
I'll send a different PR for that because the timeout thing involved a fair amount of restructuring of the code which might overly complicate things as an example. The multiple topics thing wouldn't be difficult to merge into this PR, though.
Add a brightness control message.
The MQTT example is almost sufficiently well-developed to be used as a daemon, so add a command-line parser including daemon mode (needs module python-daemon, but only if --daemon specified so no additional dependencies required for foreground use as originally intended).