UNPKG

@pmouli/isy-matter-server

Version:

Service to expose an ISY device as a Matter Border router

73 lines 3.27 kB
/* 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 KeypadRelay extends Base { commands = { DON: this.on, DOF: this.off, DFOF: this.fastOff, DFON: this.fastOn, QUERY: this.query, BEEP: this.beep, BL: this.backlight, WDU: this.writeChanges }; static nodeDefId = "KeypadRelay"; static implements = ['KeypadRelay', "IRLincTx", "KeypadButton", "KeypadButton_ADV", "EZRAIN_Output", "EZIO2x4_Output", "EZIO2x4_Input", "EZIO2x4_Input_ADV", "DoorLock", "BinaryAlarm", "BinaryAlarm_ADV", "BinaryControl", "BinaryControl_ADV", "AlertModuleArmed", "SirenAlert", "SirenArm", "PIR2844OnOff", "PIR2844OnOff_ADV"]; 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 on(value) { return this.sendCommand("DON", [value, UnitOfMeasure.Percent]); } async off() { return this.sendCommand("DOF"); } async fastOff() { return this.sendCommand("DFOF"); } async fastOn() { return this.sendCommand("DFON"); } async query() { return this.sendCommand("QUERY"); } async beep(value) { return this.sendCommand("BEEP", [value, UnitOfMeasure.LevelFrom0To255]); } async backlight(value) { return this.sendCommand("BL", [value, UnitOfMeasure.Index]); } async writeChanges() { return this.sendCommand("WDU"); } get status() { return this.drivers.ST?.value; } get responding() { return this.drivers.ERR?.value; } } NodeFactory.register(KeypadRelay); NodeFactory.register(KeypadRelay, "KeypadRelay_ADV"); (function (KeypadRelay) { function is(node) { return ['KeypadRelay', "KeypadRelay_ADV"].includes(node.nodeDefId); } KeypadRelay.is = is; function isImplementedBy(node) { return ['KeypadRelay', "KeypadRelay_ADV"].includes(node.nodeDefId); } KeypadRelay.isImplementedBy = isImplementedBy; function create(isy, nodeInfo) { return new KeypadRelay(isy, nodeInfo); } KeypadRelay.create = create; KeypadRelay.Node = KeypadRelay; KeypadRelay.Class = KeypadRelay; let Commands; (function (Commands) { Commands["on"] = "DON"; Commands["off"] = "DOF"; Commands["fastOff"] = "DFOF"; Commands["fastOn"] = "DFON"; Commands["query"] = "QUERY"; Commands["beep"] = "BEEP"; Commands["backlight"] = "BL"; Commands["writeChanges"] = "WDU"; })(Commands = KeypadRelay.Commands || (KeypadRelay.Commands = {})); let Drivers; (function (Drivers) { Drivers["status"] = "ST"; Drivers["responding"] = "ERR"; })(Drivers = KeypadRelay.Drivers || (KeypadRelay.Drivers = {})); })(KeypadRelay || (KeypadRelay = {})); //# sourceMappingURL=KeypadRelay.js.map