From 7f92cd3156863b432273354c655c0acb367856f6 Mon Sep 17 00:00:00 2001 From: zhongjin Date: Thu, 20 Dec 2018 22:06:06 +0800 Subject: [PATCH] new --- .travis.yml | 2 +- README.md | 26 ++++++++-------- admin/words.js | 2 +- appveyor.yml | 2 +- io-package.json | 10 +++--- lib/utils.js | 4 +-- main.js | 10 +++--- nodes/ioBroker.html | 66 ++++++++++++++++++++-------------------- nodes/ioBroker.js | 34 ++++++++++----------- package.json | 15 ++++----- public/selectID.js | 4 +-- settings.js | 4 +-- test/lib/setup.js | 2 +- test/testPackageFiles.js | 6 ++-- 14 files changed, 94 insertions(+), 93 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2456688..78f2ced 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_script: - 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm@5; fi' - npm -v - 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: - CXX=g++-4.8 addons: diff --git a/README.md b/README.md index 53420bd..45518b2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ ![Logo](admin/node-red.png) -# ioBroker node-red Adapter +# yunkong2 node-red Adapter ============== -[![NPM version](http://img.shields.io/npm/v/iobroker.node-red.svg)](https://www.npmjs.com/package/iobroker.node-red) -[![Downloads](https://img.shields.io/npm/dm/iobroker.node-red.svg)](https://www.npmjs.com/package/iobroker.node-red) -[![Tests](https://travis-ci.org/ioBroker/ioBroker.node-red.svg?branch=master)](https://travis-ci.org/ioBroker/ioBroker.node-red) +[![NPM version](http://img.shields.io/npm/v/yunkong2.node-red.svg)](https://www.npmjs.com/package/yunkong2.node-red) +[![Downloads](https://img.shields.io/npm/dm/yunkong2.node-red.svg)](https://www.npmjs.com/package/yunkong2.node-red) +[![Tests](https://travis-ci.org/yunkong2/yunkong2.node-red.svg?branch=master)](https://travis-ci.org/yunkong2/yunkong2.node-red) -[![NPM](https://nodei.co/npm/iobroker.node-red.png?downloads=true)](https://nodei.co/npm/iobroker.node-red/) +[![NPM](https://nodei.co/npm/yunkong2.node-red.png?downloads=true)](https://nodei.co/npm/yunkong2.node-red/) # Starts node-red instance and communicates with it. @@ -13,7 +13,7 @@ This adapter uses the node-red server from https://github.com/node-red/node-red -**Note:** If in select ID dialog of the ioBroker node you cannot find some variable, restart node-red instance. By restarting the new list of objects will be created. +**Note:** If in select ID dialog of the yunkong2 node you cannot find some variable, restart node-red instance. By restarting the new list of objects will be created. ## Changelog ### 1.7.1 (2017-09-24) @@ -30,7 +30,7 @@ This adapter uses the node-red server from https://github.com/node-red/node-red * (bluefox) add credentialSecret option ### 1.5.1 (2017-02-16) -* (Apollon77) queue set state requests till ioBroker connection has been initialized +* (Apollon77) queue set state requests till yunkong2 connection has been initialized ### 1.5.0 (2018-02-14) * (Apollon77) use newer version of node-red 0.18.2 @@ -87,7 +87,7 @@ This adapter uses the node-red server from https://github.com/node-red/node-red ### 0.4.1 (2016-01-14) * (nobodyMO) Add --max-old-space-size=128 to support systems with low memory. * (nobodyMO) Add version 0.12.5 for node-red because it works. -* (nobodyMO) Add ioBroker get node. +* (nobodyMO) Add yunkong2 get node. * (nobodyMO) Set _maxListeners = 100 to suppress warnings in the log. ### 0.3.5 (2015-08-23) @@ -100,14 +100,14 @@ This adapter uses the node-red server from https://github.com/node-red/node-red * (bluefox) enable node-red 0.11.x ### 0.3.2 (2015-06-29) -* (bluefox) fix error with ioBroker nodes +* (bluefox) fix error with yunkong2 nodes ### 0.3.1 (2015-06-28) * (bluefox) change link in admin to node-red web server ### 0.3.0 (2015-05-18) * (bluefox) add flag "stopBeforeUpdate" -* (bluefox) store data in iobroker-data directory +* (bluefox) store data in yunkong2-data directory ### 0.2.2 (2015-05-17) * (bluefox) fix error with invalid additional npm package @@ -125,7 +125,7 @@ This adapter uses the node-red server from https://github.com/node-red/node-red * (bluefox) remove warnings ### 0.1.6 (2015-03-18) -* (bluefox) make node-red compatible with ioBroker again +* (bluefox) make node-red compatible with yunkong2 again ### 0.1.5 (2015-02-12) * (bluefox) update node-red to 0.10.1 @@ -163,14 +163,14 @@ This adapter uses the node-red server from https://github.com/node-red/node-red * (bluefox) fix some errors ### 0.0.2 (2014-11-04) -* (bluefox) use adapter.js to communicate with ioBroker +* (bluefox) use adapter.js to communicate with yunkong2 ### 0.0.1 (2014-11-03) * (bluefox) initial commit ## Install -```node iobroker.js add node-red``` +```node yunkong2.js add node-red``` ## Configuration diff --git a/admin/words.js b/admin/words.js index 3c75aee..734ca8a 100644 --- a/admin/words.js +++ b/admin/words.js @@ -10,7 +10,7 @@ systemDictionary = { "Divided by comma": { "en": "Divided by comma", "de": "Getrennt mit Komma", "ru": "Через запятую", "pt": "Dividido por vírgula", "nl": "Verdeeld door een komma", "fr": "Divisé par une virgule", "it": "Diviso in virgola", "es": "Dividido por coma", "pl": "Podzielone przecinkiem"}, "Additional npm modules:": { "en": "Additional npm modules", "de": "Zusätzliche NPM-Module", "ru": "Дополнительные NPM Модули", "pt": "Módulos npm adicionais", "nl": "Extra npm-modules", "fr": "Modules NPM supplémentaires", "it": "Ulteriori moduli npm", "es": "Módulos npm adicionales", "pl": "Dodatkowe moduły npm"}, "http root directory:": { "en": "http root directory", "de": "http Stammpfad", "ru": "http root directory", "pt": "diretório raiz http", "nl": "http root directory", "fr": "répertoire racine http", "it": "directory root http", "es": "directorio raíz http", "pl": "główny katalog http"}, - "Convert values to string:": { "en": "Convert ioBroker values to string", "de": "ioBroker-Werte in String konvertieren:", "ru": "Конвертировать значения из ioBroker в строки", "pt": "Converter valores de ioBroker em string", "nl": "IoBroker-waarden converteren naar tekenreeks", "fr": "Convertir les valeurs de ioBroker en chaîne", "it": "Converti i valori di ioBroker in stringa", "es": "Convierta los valores de ioBroker en una cadena", "pl": "Konwertuj wartości ioBroker na ciąg"}, + "Convert values to string:": { "en": "Convert yunkong2 values to string", "de": "yunkong2-Werte in String konvertieren:", "ru": "Конвертировать значения из yunkong2 в строки", "pt": "Converter valores de yunkong2 em string", "nl": "yunkong2-waarden converteren naar tekenreeks", "fr": "Convertir les valeurs de yunkong2 en chaîne", "it": "Converti i valori di yunkong2 in stringa", "es": "Convierta los valores de yunkong2 en una cadena", "pl": "Konwertuj wartości yunkong2 na ciąg"}, "Add module": { "en": "Add module", "de": "Modul hinzufügen", "ru": "Добавить модуль", "pt": "Adicionar módulo", "nl": "Module toevoegen", "fr": "Ajouter un module", "it": "Aggiungi modulo", "es": "Agregar módulo", "pl": "Dodaj moduł"}, "Max allocated RAM:": { "en": "Max allocated RAM", "de": "Max zugewiesener RAM", "ru": "Выделено RAM", "pt": "RAM alocada máxima", "nl": "Max toegewezen RAM", "fr": "Max allouée RAM", "it": "RAM allocata massima", "es": "RAM máxima asignada", "pl": "Maksymalna przydzielona pamięć RAM"}, "Module names": { "en": "Module names", "de": "Modulnamen", "ru": "Имена модулей", "pt": "Nomes de módulos", "nl": "Module namen", "fr": "Noms de modules", "it": "Nomi dei moduli", "es": "Nombres de módulos", "pl": "Nazwy modułów"}, diff --git a/appveyor.yml b/appveyor.yml index 84ca0a9..bb429a7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,7 +16,7 @@ install: - ps: npm --version - npm install - 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: - echo %cd% - node --version diff --git a/io-package.json b/io-package.json index 749cf09..e4bdc04 100644 --- a/io-package.json +++ b/io-package.json @@ -38,9 +38,9 @@ "pl": "zastosowano nowszą wersję węzła-czerwonego 0.18.7\nZaimplementowano okno Admin3\nDodano ustawienia pamięci RAM" }, "1.5.1": { - "en": "queue set state requests till ioBroker connection has been initialized", - "de": "Verzögern von ioBroker-Schreibaktionen bis Verbindung zu ioBroker initialisiert wurde", - "ru": "queue set state requests till ioBroker connection has been initialized" + "en": "queue set state requests till yunkong2 connection has been initialized", + "de": "Verzögern von yunkong2-Schreibaktionen bis Verbindung zu yunkong2 initialisiert wurde", + "ru": "queue set state requests till yunkong2 connection has been initialized" }, "1.5.0": { "en": "use newer version of node-red 0.18.2", @@ -98,7 +98,7 @@ "logic", "script" ], - "extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.node-red/master/admin/node-red.png", + "extIcon": "https://raw.githubusercontent.com/yunkong2/yunkong2.node-red/master/admin/node-red.png", "localLink": "http://%ip%:%port%%httpRoot%", "enabled": true, "singletonHost": true, @@ -106,7 +106,7 @@ "unsafePerm": true, "materialize": true, "type": "logic", - "readme": "https://github.com/ioBroker/ioBroker.node-red/blob/master/README.md", + "readme": "https://github.com/yunkong2/yunkong2.node-red/blob/master/README.md", "stopBeforeUpdate": true, "adminTab": { "link": "http://%ip%:%port%%httpRoot%", diff --git a/lib/utils.js b/lib/utils.js index c8a0eb7..6af37ff 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -27,8 +27,8 @@ let appName; function getControllerDir(isInstall) { // Find the js-controller location const possibilities = [ - 'iobroker.js-controller', - 'ioBroker.js-controller', + 'yunkong2.js-controller', + 'yunkong2.js-controller', ]; /** @type {string} */ let controllerPath; diff --git a/main.js b/main.js index cb621c6..134dd11 100644 --- a/main.js +++ b/main.js @@ -1,6 +1,6 @@ /** * - * ioBroker node-red Adapter + * yunkong2 node-red Adapter * * (c) 2014 bluefox * @@ -289,7 +289,7 @@ function writeStateList(callback) { } } - fs.writeFileSync(nodePath + '/public/iobroker.json', JSON.stringify(obj)); + fs.writeFileSync(nodePath + '/public/yunkong2.json', JSON.stringify(obj)); if (callback) callback(err); }); } @@ -393,14 +393,14 @@ function installNotifierCreds(isFirst) { function main() { // Find userdata directory - // normally /opt/iobroker/node_modules/iobroker.js-controller - // but can be /example/ioBroker.js-controller + // normally /opt/yunkong2/node_modules/yunkong2.js-controller + // but can be /example/yunkong2.js-controller const controllerDir = utils.controllerDir; const parts = controllerDir.split('/'); if (parts.length > 1 && parts[parts.length - 2] === 'node_modules') { parts.splice(parts.length - 2, 2); userdataDir = parts.join('/'); - userdataDir += '/iobroker-data/node-red/'; + userdataDir += '/yunkong2-data/node-red/'; } // create userdata directory diff --git a/nodes/ioBroker.html b/nodes/ioBroker.html index 28abd18..21a4d40 100644 --- a/nodes/ioBroker.html +++ b/nodes/ioBroker.html @@ -14,7 +14,7 @@ limitations under the License. --> - - - - - -