Class: POESL

POESL

Provides methods and properties for accessing a POE stacklight.

Members


color :number

Gets/Sets the colors/buzzer of the Stacklight.

Type:
  • number
Since:
  • 0.1 (WAT 2.0)
See:

Color :object

Available colors for a Stacklight. Stacklight colors can be combined (OR'd) to perform operations on more than one color at once.

Type:
  • object
Properties:
Name Type Description
None number

0

White number

1

Blue number

2

Red number

4

Amber number

8

Green number

16

Buzzer number

32

Warble number

64

Since:
  • 0.1 (WAT 2.0)
See:

flash :number

Similar to color, but toggles the color according to onTime and offTime. The colors selected in flash will toggle after onTime ms, then again after offTime ms.

Type:
  • number
Since:
  • 0.1 (WAT 2.0)
See:
Example
sl.flash = sl.Color.White;

<readonly> isOn :number

Returns all of the colors that are either on or flashing

Type:
  • number
Since:
  • 0.1 (WAT 2.0)
See:

offTime :number

The number of milliseconds for the 'off' portion of the flash

Type:
  • number
Since:
  • 0.1 (WAT 2.0)
See:

onTime :number

The number of milliseconds for the 'on' portion of the flash

Type:
  • number
Since:
  • 0.1 (WAT 2.0)
See:

Methods


off(color)

Turn off color(s). Unspecified colors will not be changed.

Parameters:
Name Type Description
color number

The color(s) to turn off. Combination of colors.

Since:
  • 0.1 (WAT 2.0)
See:
Example
sl.off(sl.Color.Buzzer | sl.Color.Green | sl.Color.White);

on(color)

Turn on color(s). Unspecified colors will not be changed.

Parameters:
Name Type Description
color number

The color(s) to turn on. Combination of colors.

Since:
  • 0.1 (WAT 2.0)
See:
Example
sl.on(sl.Color.Red | sl.Color.Green);

pulse(milliseconds)

Pulse the buzzer. The buzzer will turn on for the specified number of milliseconds.

Parameters:
Name Type Description
milliseconds number

The number of milliseconds to turn the buzzer on for.

Since:
  • 0.1 (WAT 2.0)

toggle(color)

Toggle color(s). Unspecified colors will not be changed.

Parameters:
Name Type Description
color number

The color(s) to toggle. Combination of colors.

Since:
  • 0.1 (WAT 2.0)
See:
Example
sl.toggle(sl.Color.Amber);

Events


stateChanged

Indicates that the state of the stacklight has changed. Event will only fire if monitor mode has been enabled.

Type: object
Parameters:
Name Type Description
state object
Properties:
Name Type Description
color number

Current color setting

flash number

Current flash setting

solid number

Colors that are set, but not flashing

on number

Colors that are set or flashing

off number

Colors that are neither set nor flashing

onTime number

On time for flashing

offTime number

Off time for flashing

Since:
  • 0.1 (WAT 2.0)
See:
Example
sl.stateChanged.connect(function(state) {
   console.log('Stacklight changed to ' + state.color);
});