UNPKG

rainbird

Version:

The Rainbird library allows you to access your RainBird Controller.

31 lines 763 B
import { Response } from './Response.js'; export class ControllerDateGetResponse extends Response { response; _year; _month; _day; constructor(response) { super(); this.response = response; const monthYear = response.subarray(2, 4).toString('hex'); this._year = Number(`0x0${monthYear.substring(1, 4)}`); this._month = Number(`0x0${monthYear.substring(0, 1)}`); this._day = response[1]; } get type() { return 0x92; } get year() { return this._year; } get month() { return this._month; } get day() { return this._day; } toBuffer() { return this.response; } } //# sourceMappingURL=ControllerDateGetResponse.js.map