The cycle and timer drivers each create 2 devices, one to enable/disable the output and one to reflect the output of their internal state machine. The enable devices are boolean and a false to true transition starts their processing.
The output devices are boolean so, when enabled, the cycle driver generates a true/false/true/false chain until disabled. The timer driver outputs true for a configured length of time.
This issue proposes making the driver more general. The enable devices remain boolean, but the output device can be any supported type. The configuration for these drivers would specify a value sent to the output when it's disabled and a value when enabled. For the cycle driver, this would be an array of values.
So, to keep the same behavior as it is now, configuring the cycle driver for a 1 Hz square wave would use this:
It means configuring is a little more complicated (not much, though). And, yet, when we add the color type, you'll be able to run a sequence of colors to a LED bulb, for instance:
The
cycle
andtimer
drivers each create 2 devices, one to enable/disable the output and one to reflect the output of their internal state machine. Theenable
devices are boolean and afalse
totrue
transition starts their processing.The
output
devices are boolean so, when enabled, thecycle
driver generates atrue
/false
/true
/false
chain until disabled. Thetimer
driver outputstrue
for a configured length of time.This issue proposes making the driver more general. The
enable
devices remain boolean, but the output device can be any supported type. The configuration for these drivers would specify a value sent to the output when it's disabled and a value when enabled. For thecycle
driver, this would be an array of values.So, to keep the same behavior as it is now, configuring the
cycle
driver for a 1 Hz square wave would use this:It means configuring is a little more complicated (not much, though). And, yet, when we add the
color
type, you'll be able to run a sequence of colors to a LED bulb, for instance: