UNPKG

iobroker.valuetrackerovertime

Version:

Tracks number-changes over timepsans like hours/days/years ...

21 lines (19 loc) 393 B
'use strict'; class historyData { /** * Generate new historyData * * @param ts * @param val */ constructor(ts, val) { if (typeof ts === 'number') { if (Number(ts) > 10000) { ts = new Date(ts); } } this.val = val; this.date = ts; } } module.exports = historyData;