solarnetwork-control-toggler
v3.0.1
Published
SolarNetwork Control Toggler
Downloads
50
Readme
SolarNetwork Control Toggler
:warning: This project has been absorbed into the solarnetwork-api-core package, starting in its
3.1.0release. The classes are in the Tool sub-package.
Legacy information
Control Toggler is a helper class that uses the SolarNetwork Instruction API to
request a SolarNode to set the value of a control to 1 (on) or 0 (off), and the
SolarNetwork Datum Query API to track the value of the control.
The Instruction API is asynchronous and changing a control value requires the following steps:
- Enqueue instruction to set control value
- Wait for SolarNode to receive, execute, and update instruction status to
Completed(orRejected) - Wait for SolarNode to post updated control value datum for confirmation
Control Toggler handles these steps through a simple API for setting the desired value and using a callback function to get notified when the value changes.
Some example SolarNode plugins that support on/off switching are:
- Mock Control (good for testing)
- LATA switch
- Modbus switch
Use
To include the library in your NPM-based project, run the following:
npm i solarnetwork-control-togglerAPI docs
The latest API documentation is published here, or
you can build the API documentation by running the apidoc script:
npm run apidocThat will produce HTML documentation in docs/html.
