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:
possible values are "battery", "Ethernet", or "AC"[String] switch_mode:
returns "soft" or "hard"[String] battery:
possible values are "charging", "discharging", "complete", "absent", or "fault"[int] soc_percent:
the state of charge of the battery in percent from 0 (empty) to 100 (full)
Extensionsinformation
[String] name:
the name of the extension[int] size:
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
[float] value:
returns the "Power value"[String] units:
returns the "Power value" units ("W")
POEinformation
[String] status:
the status string can be "active", "standby", or "inactive"[POEpowerinformation] power: S
eePOEpowerinformation
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);
}) |