envision-sdk
Envision SDK
Getting started
package.json
You can put informations in your package.json, will be used for marketplace interface in Envision
index.js
Your main file, specified in package.json
const EnvisionModule = /* Functions needed for starting */ // Called when module is initialized, by envision start or installing { //server is `express()`, you can handle other routes if needed return } // Called when dashboard is stopped or system shutdown { console return } /* Express handler, refer to https://expressjs.com/en/4x/api.html for API */ // Route for settings (on your computer) { res } // Route for envision system, displayed on screen { res } exports =
Methods
this.setDashboardUrl(<url>)
this.getDashboards(cb)
this.getModules(cb)
this.getDashboardInfos(cb)
this.pushNotification(<type(error)>, <text>)
Serve static files
You can override express functions
const express = { thisonRemote = express }
Add routes
Example with POST
upload route for remote configuration
const remoteRouter = express var upload = remoteRouter remoteRouter { console thisonRemote = remoteRouter return }
API
EnvisionModule contains API to make some actions on Envision
setDashboardUrl
Can set Envision interface to a specific URL
Example:
this
getDashboards
List all dashboards in your internal networks NB: development and production dashboards are separated.
Example:
this
getModules
List all modules installed in current Envision system
Example:
this
getDashboardInfos
Get current informations about current Envision system
Example:
this
pushNotification
Send notification to Envision interface NB: if sound is at 0%, notification sound is not played
Example:
this