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.

33 lines 1.09 kB
"use strict"; import { bitArrayToArray } from "../utils/BitArray.js"; import { GroupType } from "./GW_GROUPS.js"; import { GW_FRAME_NTF, readZString } from "./common.js"; export class GW_GET_GROUP_INFORMATION_NTF extends GW_FRAME_NTF { GroupID; Order; Placement; Name; Velocity; GroupType; NodeVariation; Revision; Nodes; constructor(Data) { super(Data); this.GroupID = this.Data.readUInt8(0); this.Order = this.Data.readUInt16BE(1); this.Placement = this.Data.readUInt8(3); this.Name = readZString(this.Data.subarray(4, 68)); this.Velocity = this.Data.readUInt8(68); this.NodeVariation = this.Data.readUInt8(69); this.GroupType = this.Data.readUInt8(70); this.Revision = this.Data.readUInt16BE(97); if ([GroupType.UserGroup, GroupType.All].indexOf(this.GroupType) !== -1) { this.Nodes = bitArrayToArray(this.Data.subarray(72, 97)); } else { this.Nodes = []; } } } //# sourceMappingURL=GW_GET_GROUP_INFORMATION_NTF.js.map