@pmouli/isy-matter-server
Version:
Service to expose an ISY device as a Matter Border router
58 lines • 2.58 kB
JavaScript
/* THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT DIRECTLY. */
import { UnitOfMeasure } from "../../../Definitions/Global/index.js";
import { Base } from "../index.js";
import { Driver } from "../../../Definitions/Global/Drivers.js";
import { NodeFactory } from "../../NodeFactory.js";
export class BinaryAlarm extends Base {
commands = {
QUERY: this.query,
BEEP: this.beep,
WDU: this.writeChanges
};
static nodeDefId = "BinaryAlarm";
static implements = ['BinaryAlarm', "BinaryControl", "BinaryControl_ADV", "SirenAlert", "SirenArm"];
constructor(isy, nodeInfo) {
super(isy, nodeInfo);
this.drivers.ST = Driver.create("ST", this, nodeInfo.state['ST'], { uom: UnitOfMeasure.Percent, label: "Status", name: "status" });
this.drivers.ERR = Driver.create("ERR", this, nodeInfo.state['ERR'], { uom: UnitOfMeasure.Index, label: "Responding", name: "responding" });
}
async query() { return this.sendCommand("QUERY"); }
async beep(value) { return this.sendCommand("BEEP", [value, UnitOfMeasure.LevelFrom0To255]); }
async writeChanges() { return this.sendCommand("WDU"); }
get status() {
return this.drivers.ST?.value;
}
get responding() {
return this.drivers.ERR?.value;
}
}
NodeFactory.register(BinaryAlarm);
NodeFactory.register(BinaryAlarm, "BinaryAlarm_ADV");
(function (BinaryAlarm) {
function is(node) {
return ['BinaryAlarm', "BinaryAlarm_ADV"].includes(node.nodeDefId);
}
BinaryAlarm.is = is;
function isImplementedBy(node) {
return ['BinaryAlarm', "BallastRelayLampSwitch", "BallastRelayLampSwitch_ADV", "RelayLampSwitch", "RelayLampSwitch_ADV", "RelayLampSwitchLED", "RelayLampSwitchLED_ADV", "KeypadRelay", "KeypadRelay_ADV", "BinaryAlarm_ADV"].includes(node.nodeDefId);
}
BinaryAlarm.isImplementedBy = isImplementedBy;
function create(isy, nodeInfo) {
return new BinaryAlarm(isy, nodeInfo);
}
BinaryAlarm.create = create;
BinaryAlarm.Node = BinaryAlarm;
BinaryAlarm.Class = BinaryAlarm;
let Commands;
(function (Commands) {
Commands["query"] = "QUERY";
Commands["beep"] = "BEEP";
Commands["writeChanges"] = "WDU";
})(Commands = BinaryAlarm.Commands || (BinaryAlarm.Commands = {}));
let Drivers;
(function (Drivers) {
Drivers["status"] = "ST";
Drivers["responding"] = "ERR";
})(Drivers = BinaryAlarm.Drivers || (BinaryAlarm.Drivers = {}));
})(BinaryAlarm || (BinaryAlarm = {}));
//# sourceMappingURL=BinaryAlarm.js.map