SolarNetwork / sn-control-toggler-js

Utility to manage updating and monitoring the state of a SolarNode control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SolarNetwork Control Toggler

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 (or Rejected)
  • 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:

About

Utility to manage updating and monitoring the state of a SolarNode control.

License:Apache License 2.0


Languages

Language:TypeScript 98.1%Language:JavaScript 1.9%