You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3293,11 +3295,11 @@ function Adapter(options) {
3293
3295
if(err){
3294
3296
if(typeofcallback==='function')callback(err);
3295
3297
}else{
3296
-
that._setStateChangedHelper(id,state,callback);
3298
+
_setStateChangedHelper(id,state,callback);
3297
3299
}
3298
3300
});
3299
3301
}else{
3300
-
that._setStateChangedHelper(id,state,callback);
3302
+
_setStateChangedHelper(id,state,callback);
3301
3303
}
3302
3304
};
3303
3305
@@ -3433,11 +3435,11 @@ function Adapter(options) {
3433
3435
if(err){
3434
3436
if(typeofcallback==='function')callback(err);
3435
3437
}else{
3436
-
that._setStateChangedHelper(id,state,callback);
3438
+
_setStateChangedHelper(id,state,callback);
3437
3439
}
3438
3440
});
3439
3441
}else{
3440
-
that._setStateChangedHelper(id,state,callback);
3442
+
_setStateChangedHelper(id,state,callback);
3441
3443
}
3442
3444
};
3443
3445
@@ -3531,7 +3533,48 @@ function Adapter(options) {
3531
3533
}
3532
3534
};
3533
3535
3534
-
// normally only foreign history has interest, so there is no getHistory and getForeignHistory
3536
+
/**
3537
+
* Read historian data for states of any instance or system state.
3538
+
*
3539
+
* This function can read values from history adapters like: history, sql, influxdb. It expects the full path of object ID.
3540
+
* Normally only foreign history has interest, so there is no getHistory and getForeignHistory
3541
+
*
3542
+
* Possible options:
3543
+
*
3544
+
* - instance - (optional) name of instance, where to read the historian data, e.g. 'history.0', 'sql.1'. By default will be taken from system settings.
3545
+
* - start - (optional) time in ms - new Date().getTime()', by default is (now - 1 week)
3546
+
* - end - (optional) time in ms - new Date().getTime()', by default is (now + 5000 seconds)
3547
+
* - step - (optional) used in aggregate (m4, max, min, average, total) step in ms of intervals
3548
+
* - count - number of values if aggregate is 'onchange' or number of intervals if other aggregate method. Count will be ignored if step is set.
3549
+
* - from - if from field should be included in answer
3550
+
* - ack - if ack field should be included in answer
3551
+
* - q - if q field should be included in answer
3552
+
* - addId - if id field should be included in answer
3553
+
* - limit - do not return more entries than limit
3554
+
* - ignoreNull - if null values should be include (false), replaced by last not null value (true) or replaced with 0 (0)
3555
+
* - sessionId - (optional) identifier of request, will be returned back in the answer
3556
+
* - aggregate - aggregate method:
3557
+
* - minmax - used special algorithm. Splice the whole time range in small intervals and find for every interval max, min, start and end values.
3558
+
* - max - Splice the whole time range in small intervals and find for every interval max value and use it for this interval (nulls will be ignored).
3559
+
* - min - Same as max, but take minimal value.
3560
+
* - average - Same as max, but take average value.
3561
+
* - total - Same as max, but calculate total value.
3562
+
* - count - Same as max, but calculate number of values (nulls will be calculated).
3563
+
* - none - No aggregation at all. Only raw values in given period.
3564
+
*
3565
+
* @alias getHistory
3566
+
* @memberof Adapter
3567
+
* @param {string} id object ID of the state.
3568
+
* @param {object} options see function description
3569
+
* @param {function} callback return result
3570
+
* <pre><code>
3571
+
* function (error, result, step, sessionId) {
3572
+
* if (error) adapter.log.error('Cannot read value: ' + err);
3573
+
* }
3574
+
* </code></pre>
3575
+
*
3576
+
* See possible attributes of the state in @setState explanation
0 commit comments