node-red-contrib-home-assistant-websocket
Version:
Node-RED integration with Home Assistant through websocket and REST API
21 lines (20 loc) • 613 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.CalendarItem = void 0;
exports.createCalendarItem = createCalendarItem;
const helpers_1 = require("./helpers");
class CalendarItem {
constructor(data) {
Object.assign(this, data);
}
queueIndex() {
return `${this.uid}${this.recurrence_id || ''}`;
}
date(eventType) {
return eventType === 'start' ? (0, helpers_1.toDate)(this.start) : (0, helpers_1.toDate)(this.end);
}
}
exports.CalendarItem = CalendarItem;
function createCalendarItem(data) {
return new CalendarItem(data);
}
;