UNPKG

rainbird

Version:

The Rainbird library allows you to access your RainBird Controller.

32 lines 787 B
import { Buffer } from 'node:buffer'; import { Request } from './Request.js'; export class RunZoneRequest extends Request { _zone = 0; _duration = 0; constructor(zone, duration) { super(); this._zone = zone; this._duration = duration; } get type() { return 0x39; } get zone() { return this._zone; } set zone(value) { this._zone = value; } get duration() { return this._duration; } set duration(value) { this._duration = value; } toBuffer() { const zone = Buffer.alloc(2); zone.writeUInt16BE(this.zone); return Buffer.concat([Buffer.from([this.type]), zone, Buffer.from([this.duration])]); } } //# sourceMappingURL=RunZoneRequest.js.map