This commit is contained in:
zhongjin 2018-09-15 11:52:17 +08:00
parent 541e22701e
commit dd644dc42e
10 changed files with 24 additions and 35 deletions

View File

@ -12,7 +12,7 @@ before_script:
- 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm@5; fi' - 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm@5; fi'
- npm -v - npm -v
- npm install winston@2.3.1 - npm install winston@2.3.1
- 'npm install https://github.com/ioBroker/ioBroker.js-controller/tarball/master --production' - 'npm install https://github.com/yunkong2/yunkong2.js-controller/tarball/master --production'
env: env:
- CXX=g++-4.8 - CXX=g++-4.8
addons: addons:

View File

@ -1,12 +1,12 @@
![Logo](admin/history.png) ![Logo](admin/history.png)
# ioBroker.history # yunkong2.history
=============================== ===============================
[![NPM version](http://img.shields.io/npm/v/iobroker.history.svg)](https://www.npmjs.com/package/iobroker.history) [![NPM version](http://img.shields.io/npm/v/yunkong2.history.svg)](https://www.npmjs.com/package/yunkong2.history)
[![Downloads](https://img.shields.io/npm/dm/iobroker.history.svg)](https://www.npmjs.com/package/iobroker.history) [![Downloads](https://img.shields.io/npm/dm/yunkong2.history.svg)](https://www.npmjs.com/package/yunkong2.history)
[![Tests](http://img.shields.io/travis/ioBroker/ioBroker.history/master.svg)](https://travis-ci.org/ioBroker/ioBroker.history) [![Tests](http://img.shields.io/travis/yunkong2/yunkong2.history/master.svg)](https://travis-ci.org/yunkong2/yunkong2.history)
[![NPM](https://nodei.co/npm/iobroker.history.png?downloads=true)](https://nodei.co/npm/iobroker.history/) [![NPM](https://nodei.co/npm/yunkong2.history.png?downloads=true)](https://nodei.co/npm/yunkong2.history/)
This adapter saves state history in a two-staged process. This adapter saves state history in a two-staged process.
At first data points are stored in RAM, as soon as they reach maxLength they will be stored on disk. At first data points are stored in RAM, as soon as they reach maxLength they will be stored on disk.
@ -15,7 +15,7 @@ To set up some data points to be stored they must be configured in admin "Object
## Settings ## Settings
- **Storage directory** - Path to the directory, where the files will be stored. It can be done relative to "iobroker-data" or absolute, like "/mnt/history" or "D:/History" - **Storage directory** - Path to the directory, where the files will be stored. It can be done relative to "yunkong2-data" or absolute, like "/mnt/history" or "D:/History"
- **Maximal number of stored in RAM values** - After this number of values reached in RAM they will be saved on disk. - **Maximal number of stored in RAM values** - After this number of values reached in RAM they will be saved on disk.
- **Store origin of value** - If "from" field will be stored too. Can save place on disk. - **Store origin of value** - If "from" field will be stored too. Can save place on disk.
- **De-bounce interval** - Protection against too often changes of some value and defined tha time in ms in which after one value change other changes are not logged - **De-bounce interval** - Protection against too often changes of some value and defined tha time in ms in which after one value change other changes are not logged
@ -86,7 +86,7 @@ If you manually request some aggregation you should ignore first and last values
If you want to write other data into the InfluxDB you can use the build in system function **storeState**. If you want to write other data into the InfluxDB you can use the build in system function **storeState**.
This function can also be used to convert data from other History adapters like History or SQL. This function can also be used to convert data from other History adapters like History or SQL.
The given ids are not checked against the ioBroker database and do not need to be set up there, but can only be accessed directly. The given ids are not checked against the yunkong2 database and do not need to be set up there, but can only be accessed directly.
The Message can have one of the following three formats: The Message can have one of the following three formats:
* one ID and one state object * one ID and one state object
@ -225,7 +225,7 @@ Possible options and Parameter:
- **DB-Instance**: DB-Instance to send the data to.Required parameter. Needs to be first parameter after scriptname. - **DB-Instance**: DB-Instance to send the data to.Required parameter. Needs to be first parameter after scriptname.
- **Loglevel**: Loglevel for output (Default: info). If set needs to be second parameter after scriptname. - **Loglevel**: Loglevel for output (Default: info). If set needs to be second parameter after scriptname.
- **Date-to-start**: Day to start in format yyyymmdd (e.g. 20161028). Use "0" to use detected earliest values. If set needs to be third parameter after scriptname. - **Date-to-start**: Day to start in format yyyymmdd (e.g. 20161028). Use "0" to use detected earliest values. If set needs to be third parameter after scriptname.
- **path-to-Data**: Path to the datafiles. Defauls to iobroker-install-directory/iobroker-data/history-data . If set needs to be fourth parameter after scriptname. - **path-to-Data**: Path to the datafiles. Defauls to yunkong2-install-directory/yunkong2-data/history-data . If set needs to be fourth parameter after scriptname.
- **<delayMultiplicator>**: Modify the delays between several actions in the script by a multiplicator. "2" would mean that the delays the converted had calculated by itself are doubled. If set needs to be fifth parameter after scriptname. - **<delayMultiplicator>**: Modify the delays between several actions in the script by a multiplicator. "2" would mean that the delays the converted had calculated by itself are doubled. If set needs to be fifth parameter after scriptname.
- **--logChangesOnly [relog-Interval(m)]**: when --logChangesOnly is set the data are parsed and reduced, so that only changed values are stored in InfluxDB. Additionally a "relog-Interval(s)"" can be set in minutes to re-log unchanged values after this interval. - **--logChangesOnly [relog-Interval(m)]**: when --logChangesOnly is set the data are parsed and reduced, so that only changed values are stored in InfluxDB. Additionally a "relog-Interval(s)"" can be set in minutes to re-log unchanged values after this interval.
- **--ignoreExistingDBValues**: With this parameter all existing data are ignored and all data are inserted into DB. Please make sure that no duplicates are generated. This option is usefull to fix "holes" in the data where some data are missing. By default it only fills all datapoints with at least one entry in the DB. This can be overwritten by --processAllDPs - **--ignoreExistingDBValues**: With this parameter all existing data are ignored and all data are inserted into DB. Please make sure that no duplicates are generated. This option is usefull to fix "holes" in the data where some data are missing. By default it only fills all datapoints with at least one entry in the DB. This can be overwritten by --processAllDPs

View File

@ -1,4 +1,4 @@
<script type="text/x-iobroker" data-template-name="history"> <script type="text/x-yunkong2" data-template-name="history">
<div class="form-row"> <div class="form-row">
<table style="font-size: 12px"> <table style="font-size: 12px">
<tr> <tr>

View File

@ -1,4 +1,4 @@
<script type="text/x-iobroker" data-template-name="history"> <script type="text/x-yunkong2" data-template-name="history">
<div class="row"> <div class="row">
<div class="col s4"> <div class="col s4">
<input type="checkbox" data-field="enabled" data-default="false"/> <input type="checkbox" data-field="enabled" data-default="false"/>

View File

@ -16,7 +16,7 @@ install:
- ps: npm --version - ps: npm --version
- npm install - npm install
- npm install winston@2.3.1 - npm install winston@2.3.1
- 'npm install https://github.com/ioBroker/ioBroker.js-controller/tarball/master --production' - 'npm install https://github.com/yunkong2/yunkong2.js-controller/tarball/master --production'
test_script: test_script:
- echo %cd% - echo %cd%
- node --version - node --version

View File

@ -182,9 +182,9 @@
"Apollon77 <ingo@fischer-ka.de>" "Apollon77 <ingo@fischer-ka.de>"
], ],
"license": "MIT", "license": "MIT",
"readme": "https://github.com/ioBroker/ioBroker.history/blob/master/README.md", "readme": "https://git.spacen.net/yunkong2/yunkong2.history/raw/master/README.md",
"icon": "history.png", "icon": "history.png",
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.history/master/admin/history.png", "extIcon": "https://git.spacen.net/yunkong2/yunkong2.history/raw/master/admin/history.png",
"type": "storage", "type": "storage",
"supportCustoms": true, "supportCustoms": true,
"materialize": true, "materialize": true,

View File

@ -27,8 +27,8 @@ let appName;
function getControllerDir(isInstall) { function getControllerDir(isInstall) {
// Find the js-controller location // Find the js-controller location
const possibilities = [ const possibilities = [
'iobroker.js-controller', 'yunkong2.js-controller',
'ioBroker.js-controller', 'yunkong2.js-controller',
]; ];
/** @type {string} */ /** @type {string} */
let controllerPath; let controllerPath;

View File

@ -1,27 +1,19 @@
{ {
"name": "iobroker.history", "name": "yunkong2.history",
"description": "Log state history in a two-stages process (first to RAM, then to disk)", "description": "Log state history in a two-stages process (first to RAM, then to disk)",
"version": "1.8.5", "version": "1.8.5",
"author": "hobbyquaker <hq@ccu.io>", "homepage": "https://git.spacen.net/yunkong2/yunkong2.history",
"contributors": [
"bluefox <dogafox@gmail.com>",
"smiling-Jack",
"hobbyquaker <hq@ccu.io>",
"Apollon77"
],
"homepage": "https://github.com/ioBroker/ioBroker.history",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ioBroker/ioBroker.history" "url": "https://git.spacen.net/yunkong2/yunkong2.history"
}, },
"licenses": [ "licenses": [
{ {
"type": "MIT", "type": "MIT",
"url": "https://github.com/ioBroker/ioBroker.history/blob/master/LICENSE" "url": "https://git.spacen.net/yunkong2/yunkong2.history/blob/master/LICENSE"
} }
], ],
"keywords": [ "keywords": [
"ioBroker",
"log data", "log data",
"home automation" "home automation"
], ],
@ -31,9 +23,6 @@
"mocha": "^4.1.0", "mocha": "^4.1.0",
"chai": "^4.1.2" "chai": "^4.1.2"
}, },
"bugs": {
"url": "https://github.com/ioBroker/ioBroker.history/issues"
},
"main": "history.js", "main": "history.js",
"scripts": { "scripts": {
"test": "node node_modules/mocha/bin/mocha --exit" "test": "node node_modules/mocha/bin/mocha --exit"

View File

@ -415,7 +415,7 @@ function clearControllerLog() {
} }
function clearDB() { function clearDB() {
var dirPath = rootDir + 'tmp/iobroker-data/sqlite'; var dirPath = rootDir + 'tmp/yunkong2-data/sqlite';
var files; var files;
try { try {
if (fs.existsSync(dirPath)) { if (fs.existsSync(dirPath)) {

View File

@ -52,12 +52,12 @@ describe('Test package.json and io-package.json', function() {
console.log(); console.log();
} }
if ( if (
ioPackage.common.title.indexOf('iobroker') !== -1 || ioPackage.common.title.indexOf('yunkong2') !== -1 ||
ioPackage.common.title.indexOf('ioBroker') !== -1 || ioPackage.common.title.indexOf('yunkong2') !== -1 ||
ioPackage.common.title.indexOf('adapter') !== -1 || ioPackage.common.title.indexOf('adapter') !== -1 ||
ioPackage.common.title.indexOf('Adapter') !== -1 ioPackage.common.title.indexOf('Adapter') !== -1
) { ) {
console.log('WARNING: title contains Adapter or ioBroker. It is clear anyway, that it is adapter for ioBroker.'); console.log('WARNING: title contains Adapter or yunkong2. It is clear anyway, that it is adapter for yunkong2.');
console.log(); console.log();
} }