This object represents an RGB LED connected to the Physical UI server.


Singleton Methods


Returns an object for the LED matching the given id.

var statusRGB = radiodan.RGBLED.create('status');

Emit Options

All the instance methods accept either a single or array of emit options. The options are a plain Javascript object, with the following keys:


The colour of the light you would like emitted. Colours are represented as an array of RGB colours, from 0-255. When all colours at 0, the LED will be unlit.


An object that expresses how to move from the current state to this new one. The default is to imeediately wipe out the current state. The transition object includes:


The length of time for the duration to last, in miliseconds.


Whether this transition should be looped indefinitely (or, atleast, until another transition wipes it out). Accepts a boolean.


The Physical UI supports the full range of easing functions. Accepts a string that matches an easing function.

Instance Methods


Alters the state of the LED. This will be accepted and immediately executed in place of the previous state. The promise will resolve if accepted by the Physical UI server, or else it will be rejected.

  colour: [255, 0, 128], // RGB colour
  transition: {
    duration: 1000, // in ms
    yoyo: true, // boolean
    easing: 'easingFuncName' // from this list


Sets up multiple LED transitions, to be executed one after the other. Accepts an array of emit objects.

  queue: [
    // emit blue over one second
      colour: [0, 0, 255],
      transition: {
        duration: 1000
    // then emit red using default transitions (or instantly)
      colour: [255, 0, 0],