Constructor
(package) new PhysicalTrafficLightSelector(optionsopt)
- Source:
- See:
Selects a physical traffic light to use. Checks-out and uses a specific traffic light or the first available one to issue commands.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Options. Properties
|
Extends
- EventEmitter
Methods
close()
- Source:
- See:
Called to close this instance and to stop monitoring for devices. Should be done as the last operation before exiting the process.
logInfo(loggeropt)
Logs information about known devices.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
logger |
object |
<optional> |
console
|
A Console-like object for logging. |
resolveTrafficLight() → {physical.PhysicalTrafficLight}
Retrieves a traffic light for exclusive usage of the caller,
or null
if one could not be found or checked-out.
Traffic lights are released (checked-in) when disconnected.
Returns:
- A traffic light, or
null
.
Events
disabled
Traffic light disabled event. Only fired if the specific traffic light that was checked-out was disconnected.
enabled
Traffic light enabled event. Only fired if there's currently no checked-out traffic light.