-
Notifications
You must be signed in to change notification settings - Fork 4
MQTT
The general scheme is led/{sys_name}/show/{show_name}/{command}
The MQTT controller listens for the commands start
, stop
and brightness
for all shows. Any other commands (all except for start
, stop
and brightness
) are up to the individual lightshow.
The MQTT controller stops (see below) any running show.
Then it checks if the given parameters (the JSON payload of the MQTT start message) are valid by invoking show.parameters_valid(parameters)
.
If the show calls the parameters valid, the controller starts a new process where show.run(strip, conf, parameters)
.
The MQTT controller asks the lightshow process kindly to join and after a timeout (usually less than a second) terminates the lightshow process if still running. Then the controller clears the LED strip buffer (without invoking strip.show()
)
The MQTT controller sets the brightness prefix (0 to 31) for all the LEDs in the strip and then invokes strip.show()
As each lightshow gets the global conf
object it can itself subscribe to MQTT messages and respond to them.