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.12 kB
"use strict"; import { GW_FRAME_CFM } from "./common.js"; import { ModeStatus } from "./GW_COMMAND.js"; export class GW_MODE_SEND_CFM extends GW_FRAME_CFM { SessionID; ModeStatus; constructor(Data) { super(Data); this.SessionID = this.Data.readUInt16BE(0); this.ModeStatus = this.Data.readUInt8(2); } getError() { switch (this.ModeStatus) { case ModeStatus.OK: throw new Error("No error."); case ModeStatus.CommandRejected: return "Command rejected."; case ModeStatus.UnknownClientID: return "Unknown client ID."; case ModeStatus.SessionIDInUse: return "Session ID in use."; case ModeStatus.Busy: return "Busy."; case ModeStatus.IllegalParameterValue: return "Invalid parameter value."; case ModeStatus.Failed: return "Failed."; default: return `Unknown error ${this.ModeStatus}.`; } } } //# sourceMappingURL=GW_MODE_SEND_CFM.js.map