UNPKG

rainbird

Version:

The Rainbird library allows you to access your RainBird Controller.

40 lines 944 B
import { Buffer } from 'node:buffer'; import { Request } from './Request.js'; export class ControllerDateSetRequest extends Request { _day = 0; _month = 0; _year = 0; constructor(day, month, year) { super(); this._day = day; this._month = month; this._year = year; } get type() { return 0x13; } get day() { return this._day; } set day(value) { this._day = value; } get month() { return this._month; } set month(value) { this._month = value; } get year() { return this._year; } set year(value) { this._year = value; } toBuffer() { const monthYear = Buffer.alloc(2); monthYear.writeUInt16BE(this.month * 4096 + this.year); return Buffer.concat([Buffer.from([this.type, this.day]), monthYear]); } } //# sourceMappingURL=ControllerDateSetRequest.js.map