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.

62 lines 2.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GW_GET_NODE_INFORMATION_NTF = void 0; const common_js_1 = require("./common.js"); const GW_SYSTEMTABLE_DATA_js_1 = require("./GW_SYSTEMTABLE_DATA.js"); class GW_GET_NODE_INFORMATION_NTF extends common_js_1.GW_FRAME_NTF { NodeID; Order; Placement; Name; Velocity; ActuatorType; ActuatorSubType; ProductGroup; ProductType; NodeVariation; PowerSaveMode; SerialNumber; OperatingState; CurrentPosition; TargetPosition; FunctionalPosition1CurrentPosition; FunctionalPosition2CurrentPosition; FunctionalPosition3CurrentPosition; FunctionalPosition4CurrentPosition; RemainingTime; TimeStamp; ActuatorAliases = []; constructor(Data) { super(Data); this.NodeID = this.Data.readUInt8(0); this.Order = this.Data.readUInt16BE(1); this.Placement = this.Data.readUInt8(3); this.Name = (0, common_js_1.readZString)(this.Data.subarray(4, 68)); this.Velocity = this.Data.readUInt8(68); const actuatorTypes = (0, GW_SYSTEMTABLE_DATA_js_1.splitActuatorType)(this.Data.readUInt16BE(69)); this.ActuatorType = actuatorTypes.ActuatorType; this.ActuatorSubType = actuatorTypes.ActuatorSubType; this.ProductGroup = this.Data.readUInt8(71); this.ProductType = this.Data.readUInt8(72); this.NodeVariation = this.Data.readUInt8(73); this.PowerSaveMode = this.Data.readUInt8(74); this.SerialNumber = this.Data.subarray(76, 84); this.OperatingState = this.Data.readUInt8(84); this.CurrentPosition = this.Data.readUInt16BE(85); this.TargetPosition = this.Data.readUInt16BE(87); this.FunctionalPosition1CurrentPosition = this.Data.readUInt16BE(89); this.FunctionalPosition2CurrentPosition = this.Data.readUInt16BE(91); this.FunctionalPosition3CurrentPosition = this.Data.readUInt16BE(93); this.FunctionalPosition4CurrentPosition = this.Data.readUInt16BE(95); this.RemainingTime = this.Data.readUInt16BE(97); this.TimeStamp = new Date(this.Data.readUInt32BE(99) * 1000); // Read actuator aliases const numberOfAliases = this.Data.readUInt8(103); for (let index = 0; index < numberOfAliases; index++) { const alias = new GW_SYSTEMTABLE_DATA_js_1.ActuatorAlias(this.Data.readUInt16BE(index * 4 + 104), this.Data.readUInt16BE(index * 4 + 106)); this.ActuatorAliases.push(alias); } } } exports.GW_GET_NODE_INFORMATION_NTF = GW_GET_NODE_INFORMATION_NTF; //# sourceMappingURL=GW_GET_NODE_INFORMATION_NTF.js.map