A driver for the LiteTouch lighting control Real Time Control protocol.
Usage
Call the connect function to connect with the LiteTouch controller. After the connection has been established, proceed by interacting with the controller.
var LiteTouch = ;var litetouch = LiteTouch;
You may also provide a duplex stream to the LiteTouch constructor directly.
var LiteTouch = net = ; var socket = netvar litetouch = socket;
Events
Events are emitted when the LiteTouch controller sends notifications of state change. Before any notifications are sent
by the controller, the client must use the internalEventNotify
function to instruct the controller to send them. To turn
on all events, call internalEventNotify(7)
.
Switch Press, Hold and Release
Clients may register a listener function to be called when any switch is pressed, held or released. The event name
describes the particulars of the event in the following format: <event type>:<station address>,<switch number>
.
Example:
litetouch; // can use 2 or 7 instead // listen for specific button eventslitetouch;litetouch;litetouch; // listen to all button events, for every station and switchlitetouch
Timer and User Events
Clients may register a listener function to be called when a timer or user event occurs.
Example:
litetouch; // can use 2 or 7 instead // listen to specific timer and user eventslitetouch;litetouch; // listen to all timer and user eventslitetouch;litetouch;
LED Update Events
LED Update events occur when LEDs on a switch station change. Clients may register a listener function to be called when the LED state changes.
Example:
litetouch; // can use 2 or 7 instead // listen to LED events for a particular stationlitetouch; // listen to LED events for all stationslitetouch;
Module Update Events
Module Update events occur when lighting loads on a LiteTouch module are changed. This happens when loads are dimmed, brightened, turned on or turned off.
Clients may register a listener function to be called when loads change on a module.
Example:
litetouch; // can use 2 or 7 instead // listen to module update events for a particular modulelitetouch; // listen to module update events for all moduleslitetouch;
Contributing
Pull requests are welcome.
- Fork this repo.
git checkout -B yourbranch
- Make your changes.
- Open a pull request between your branch and master.