UNPKG

klf-200-api

Version:

This module provides a wrapper to the socket API of a Velux KLF-200 interface. You will need at least firmware 0.2.0.0.71 on your KLF interface for this library to work.

41 lines 1.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GW_SET_GROUP_INFORMATION_REQ = void 0; const BitArray_js_1 = require("../utils/BitArray.js"); const common_js_1 = require("./common.js"); class GW_SET_GROUP_INFORMATION_REQ extends common_js_1.GW_FRAME_REQ { GroupID; Revision; Name; GroupType; Nodes; Order; Placement; Velocity; NodeVariation; constructor(GroupID, Revision, Name, GroupType, Nodes, Order = 0, Placement = 0, Velocity = 0, NodeVariation = 0) { super(99); this.GroupID = GroupID; this.Revision = Revision; this.Name = Name; this.GroupType = GroupType; this.Nodes = Nodes; this.Order = Order; this.Placement = Placement; this.Velocity = Velocity; this.NodeVariation = NodeVariation; const buff = this.Data.subarray(this.offset); // View on the internal buffer makes setting the data easier buff.writeUInt8(this.GroupID, 0); buff.writeUInt16BE(this.Order, 1); buff.writeUInt8(this.Placement, 3); buff.write(this.Name, 4, 64, "utf8"); buff.writeUInt8(this.Velocity, 68); buff.writeUInt8(this.NodeVariation, 69); buff.writeUInt8(this.GroupType, 70); buff.writeUInt8(this.Nodes.length, 71); (0, BitArray_js_1.arrayToBitArray)(this.Nodes, 25, buff.subarray(72, 97)); buff.writeUInt16BE(this.Revision, 97); } } exports.GW_SET_GROUP_INFORMATION_REQ = GW_SET_GROUP_INFORMATION_REQ; //# sourceMappingURL=GW_SET_GROUP_INFORMATION_REQ.js.map