Object Creation
To create a devicestatus object, load the @brightsign/status module using the require()
method.
Code Block | ||
---|---|---|
| ||
var DeviceStatusClass = require("@brightsign/devicestatus"); var devicestatus = new DeviceStatusClass(); |
devicestatus
getPowerStatus()
Code Block | ||
---|---|---|
| ||
Promise<Powerinformation> getPowerStatus() |
Returns the device battery status as "charging", "discharging", "complete", "absent", or "fault".
getExtensions()
Code Block | ||
---|---|---|
| ||
Promise<ExtensionsinformationList> getExtensions() |
Returns a promise which yields an object containing an extensions
array with each element containing at least a name
field. Other fields may also be present, but should not be relied on.
getPOEStatus()
Code Block | ||
---|---|---|
| ||
Promise<POEinformation> getPOEStatus() |
Returns information about whether PoE (Power over Ethernet) network is supported, available, and/or active on a device.
Powerinformation
[String] source
string: possible Possible values are "battery", "Ethernet", or "AC"[String] switch_mode
string: returns Returns "soft" or "hard"[String] battery
string: possible Possible values are "charging", "discharging", "complete", "absent", or "fault"[int] soc_percent
int: the The state of charge of the battery in percent from 0 (empty) to 100 (full)
Extensionsinformation
[String] name
string: the The name of the extension[size
int] size: some Some extensions return a size and others do not. Players that have AC3 or E-AC3 licenses installed will report those as extensions but no size will be included.
POEpowerinformation
[value
float] value: returns Returns the "Power value"[String] units
string: returns the "Power value" units ("W")
POEinformation
[String] status
string: the The status string can be "active", "standby", or "inactive"[power
POEpowerinformation] power: See SeePOEpowerinformation
above for details.
Example
To get the power status of a device:
Code Block | ||
---|---|---|
| ||
var DeviceStatusClass = require("@brightsign/devicestatus"); var devicestatus = new DeviceStatusClass(); devicestatus.getPowerStatus().then( function(data){ console.log(JSON.stringify(data)); }) .catch( function(data){ console.log("Error: " + data); }) |