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.
16 lines • 595 B
JavaScript
import { C_MAX_PWD_LENGTH, GW_FRAME_REQ } from "./common.js";
export class GW_PASSWORD_ENTER_REQ extends GW_FRAME_REQ {
constructor(password) {
super(C_MAX_PWD_LENGTH);
this.Password = password;
}
set Password(newPassword) {
const buffer = Buffer.from(newPassword, "utf8");
if (buffer.byteLength > C_MAX_PWD_LENGTH)
throw new Error("Password must not exceed 32 characters length.");
this.Data.fill(0, this.offset);
buffer.copy(this.Data, this.offset);
}
}
//# sourceMappingURL=GW_PASSWORD_ENTER_REQ.js.map
;