status pending from SolarNetwork...
This example demonstrates using the Control Toggler
class to power a simple UI for turning a SolarNode switch on/off. Control Toggler 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.
To change the node ID, reload this page with a ?nodeId=X added to the URL, where X
is the ID of the node you'd like to control.
The Instruction API is asynchronous and changing a control value requires the following steps:
Completed (or Rejected)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: