@pmouli/isy-matter-server
Version:
Service to expose an ISY device as a Matter Border router
50 lines • 2.15 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 DimmerSwitch extends Base {
commands = {
BL: this.backlight,
WDU: this.writeChanges
};
static nodeDefId = "DimmerSwitchOnly";
static implements = ['DimmerSwitchOnly', "SirenAlert", "SirenArm"];
constructor(isy, nodeInfo) {
super(isy, nodeInfo);
this.drivers.ERR = Driver.create("ERR", this, nodeInfo.state['ERR'], { uom: UnitOfMeasure.Index, label: "Responding", name: "responding" });
}
async backlight(value) { return this.sendCommand("BL", [value, UnitOfMeasure.Percent]); }
async writeChanges() { return this.sendCommand("WDU"); }
get responding() {
return this.drivers.ERR?.value;
}
}
NodeFactory.register(DimmerSwitch);
NodeFactory.register(DimmerSwitch, "DimmerSwitchOnly_ADV");
(function (DimmerSwitch) {
function is(node) {
return ['DimmerSwitchOnly', "DimmerSwitchOnly_ADV"].includes(node.nodeDefId);
}
DimmerSwitch.is = is;
function isImplementedBy(node) {
return ['DimmerSwitchOnly', "DimmerLampSwitch", "DimmerLampSwitch_ADV", "DimmerLampSwitchLED", "DimmerLampSwitchLED_ADV", "DimmerSwitchOnly_ADV"].includes(node.nodeDefId);
}
DimmerSwitch.isImplementedBy = isImplementedBy;
function create(isy, nodeInfo) {
return new DimmerSwitch(isy, nodeInfo);
}
DimmerSwitch.create = create;
DimmerSwitch.Node = DimmerSwitch;
DimmerSwitch.Class = DimmerSwitch;
let Commands;
(function (Commands) {
Commands["backlight"] = "BL";
Commands["writeChanges"] = "WDU";
})(Commands = DimmerSwitch.Commands || (DimmerSwitch.Commands = {}));
let Drivers;
(function (Drivers) {
Drivers["responding"] = "ERR";
})(Drivers = DimmerSwitch.Drivers || (DimmerSwitch.Drivers = {}));
})(DimmerSwitch || (DimmerSwitch = {}));
//# sourceMappingURL=DimmerSwitch.js.map