Class: POESL

POESL

Provides methods and properties for accessing a POE stacklight.


Extends

Members


color :number

Gets/Sets the colors/buzzer of the Stacklight.

Type:
  • number
Since:
  • 1.0 (WAT 1.0)
Inherited From:
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)
Overrides:
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:
  • 1.0 (WAT 1.0)
Inherited From:
See:
Example
sl.color = sl.Color.White;

<readonly> isOn :number

Returns all of the colors that are either on or flashing

Do not use for WS API clients.

Type:
  • number
Since:
  • 1.3 (WAT 1.4)
Inherited From:
See:

offTime :number

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

Type:
  • number
Since:
  • 1.0 (WAT 1.0)
Inherited From:
See:

onTime :number

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

Type:
  • number
Since:
  • 1.0 (WAT 1.0)
Inherited From:
See:

Methods


off(color)

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

Parameters:
Name Type Description
color number

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

Since:
  • 1.0 (WAT 1.0)
Inherited From:
See:
Example
sl.off(sl.Color.Buzz | sl.Color.Green | sl.Color.White);

on(color)

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

Parameters:
Name Type Description
color number

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

Since:
  • 1.0 (WAT 1.0)
Inherited From:
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:
  • 1.0 (WAT 1.0)
Inherited From:

toggle(color)

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

Parameters:
Name Type Description
color number

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

Since:
  • 1.0 (WAT 1.0)
Inherited From:
See:
Example
sl.toggle(sl.Color.Yellow);

Events


colorChanged

Indicates that the color of the stacklight has changed.

Type: number
Since:
  • 2.5 (WAT 2.4)
Inherited From:

flashChanged

Indicates that the flashing color of the stacklight has changed.

Type: number
Since:
  • 2.5 (WAT 2.4)
Inherited From:

offTimeChanged

Indicates that the off time for the flashing colors has changed.

Type: number
Since:
  • 2.5 (WAT 2.4)
Inherited From:

onTimeChanged

Indicates that the on time for the flashing colors has changed.

Type: number
Since:
  • 2.5 (WAT 2.4)
Inherited From:

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:
  • 1.0 (WAT 1.0)
Inherited From:
See:
Example
sl.stateChanged.connect(function(state) {
   console.log('Stacklight changed to ' + state.color);
});