PhysicalTrafficLight

physical. PhysicalTrafficLight

A physical traffic light.

Constructor

new PhysicalTrafficLight(device, redopt, yellowopt, greenopt)

Source:
Parameters:
Name Type Attributes Description
device physical.Device

The device associated with this traffic light.

red physical.PhysicalLight <optional>

Red light.

yellow physical.PhysicalLight <optional>

Yellow light.

green physical.PhysicalLight <optional>

Green light.

Extends

Members

green :trafficLight.Light

Description:
  • The green light.

Source:
Overrides:

The green light.

Type:

isAvailable :boolean

Description:
  • If the traffic light is available: enabled and not checked-out.

Source:
Overrides:

If the traffic light is available: enabled and not checked-out.

Type:
  • boolean

isCheckedOut :boolean

Description:
  • If the traffic light is checked-out or reserved.

Source:
Overrides:

If the traffic light is checked-out or reserved.

Type:
  • boolean

isConnected :boolean

Description:
  • If the traffic light's device is connected. Same as isEnabled.

Source:

If the traffic light's device is connected. Same as isEnabled.

Type:
  • boolean

isEnabled :boolean

Description:
  • If the traffic light is enabled and ready to use. Same as isConnected.

Source:
Overrides:

If the traffic light is enabled and ready to use. Same as isConnected.

Type:
  • boolean

red :trafficLight.Light

Description:
  • The red light.

Source:
Overrides:

The red light.

Type:

yellow :trafficLight.Light

Description:
  • The yellow light.

Source:
Overrides:

The yellow light.

Type:

Methods

checkIn()

Description:
  • Checks-in the traffic light, making it available for checking out again.

Source:
Overrides:

checkOut() → {boolean}

Description:
  • Checks-out or reserve the traffic light for exclusive usage, making it unavailable for other users.

Source:
Overrides:
Returns:

True if the traffic light was successfully checked out. False if it was already checked out.

Type
boolean

reset()

Description:
  • Sets all lights to off.

Source:
Overrides:

(async) sync()

Description:
  • Syncs the physical lights in the device with the state of this instance.

Source:

Events

disabled

Description:
  • Traffic light disabled event.

Source:
Overrides:

enabled

Description:
  • Traffic light enabled event.

Source:
Overrides: