This commit is contained in:
2019-01-16 09:09:54 +08:00
parent 0cc08f136d
commit b2eeb13f83
12 changed files with 29 additions and 150 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ before_script:
- npm -v - npm -v
- npm install winston@2.3.1 - npm install winston@2.3.1
- npm install mqtt@2.13.0 - npm install mqtt@2.13.0
- '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:
+5 -5
View File
@@ -1,12 +1,12 @@
![Logo](admin/sonoff.png) ![Logo](admin/sonoff.png)
# ioBroker Sonoff # yunkong2 Sonoff
============== ==============
[![NPM version](http://img.shields.io/npm/v/iobroker.sonoff.svg)](https://www.npmjs.com/package/iobroker.sonoff) [![NPM version](http://img.shields.io/npm/v/yunkong2.sonoff.svg)](https://www.npmjs.com/package/yunkong2.sonoff)
[![Downloads](https://img.shields.io/npm/dm/iobroker.sonoff.svg)](https://www.npmjs.com/package/iobroker.sonoff) [![Downloads](https://img.shields.io/npm/dm/yunkong2.sonoff.svg)](https://www.npmjs.com/package/yunkong2.sonoff)
[![Tests](https://travis-ci.org/ioBroker/ioBroker.sonoff.svg?branch=master)](https://travis-ci.org/ioBroker/ioBroker.sonoff) [![Tests](https://travis-ci.org/yunkong2/yunkong2.sonoff.svg?branch=master)](https://travis-ci.org/yunkong2/yunkong2.sonoff)
[![NPM](https://nodei.co/npm/iobroker.sonoff.png?downloads=true)](https://nodei.co/npm/iobroker.sonoff/) [![NPM](https://nodei.co/npm/yunkong2.sonoff.png?downloads=true)](https://nodei.co/npm/yunkong2.sonoff/)
Requires node.js 4.0 or higher. Requires node.js 4.0 or higher.
+1 -1
View File
@@ -17,7 +17,7 @@ install:
- npm install - npm install
- npm install winston@2.3.1 - npm install winston@2.3.1
- npm install mqtt@2.13.0 - npm install mqtt@2.13.0
- '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
+3 -123
View File
@@ -2,129 +2,9 @@
"common": { "common": {
"name": "sonoff", "name": "sonoff",
"version": "2.2.3", "version": "2.2.3",
"news": {
"2.2.3": {
"en": "Support for compact mode",
"de": "Unterstützung für den Kompaktmodus",
"ru": "Поддержка компактного режима",
"pt": "Suporte para o modo compacto",
"nl": "Ondersteuning voor de compacte modus",
"fr": "Prise en charge du mode compact",
"it": "Supporto per la modalità compatta",
"es": "Soporte para modo compacto",
"pl": "Obsługa trybu kompaktowego"
},
"2.2.2": {
"en": "Configuration was fixed",
"de": "Die Konfiguration wurde repariert",
"ru": "Конфигурация была исправлена",
"pt": "Configuração foi corrigida",
"nl": "Configuratie was opgelost",
"fr": "La configuration a été corrigée",
"it": "La configurazione è stata riparata",
"es": "La configuración fue arreglada",
"pl": "Konfiguracja została naprawiona"
},
"2.2.1": {
"en": "- in names was allowed again",
"de": "- in Namen wurde wieder erlaubt",
"ru": "- в именах снова было разрешено",
"pt": "- nos nomes foi permitido novamente",
"nl": "- in namen was weer toegestaan",
"fr": "- dans les noms a été autorisé à nouveau",
"it": "- nei nomi è stato permesso di nuovo",
"es": "- en los nombres se permitió de nuevo",
"pl": "- w nazwach było ponownie dozwolone"
},
"2.2.0": {
"en": "Auto generate of objects was implemented",
"de": "Auto-Generierung von Objekten wurde implementiert",
"ru": "Была реализована автоматическая генерация объектов",
"pt": "Geração automática de objetos foi implementada",
"nl": "Automatisch genereren van objecten is geïmplementeerd",
"fr": "La génération automatique d'objets a été implémentée",
"it": "È stata implementata la generazione automatica di oggetti",
"es": "Generación automática de objetos fue implementado",
"pl": "Automatycznie generowano obiekty"
},
"2.1.3": {
"en": "Added HC-SR04 Ultrasonic Sensor",
"de": "HC-SR04 Ultraschallsensor hinzugefügt",
"ru": "Добавлен ультразвуковой датчик HC-SR04",
"pt": "Adicionado Sensor Ultrassônico HC-SR04",
"nl": "HC-SR04 ultrasone sensor toegevoegd",
"fr": "Capteur à ultrasons HC-SR04 ajouté",
"it": "Aggiunto il sensore a ultrasuoni HC-SR04",
"es": "Sensor ultrasónico HC-SR04 agregado",
"pl": "Dodano czujnik ultradźwiękowy HC-SR04"
},
"2.1.2": {
"en": "Added support of UvLight, Longitude and Latitude",
"de": "Zusätzliche Unterstützung von UvLight, Longitude und Latitude",
"ru": "Добавлена ​​поддержка UvLight, долготы и широты",
"pt": "Adicionado suporte de UvLight, Longitude e Latitude",
"nl": "Ondersteuning toegevoegd van UvLight, Longitude en Latitude",
"fr": "Ajout du support de UvLight, Longitude et Latitude",
"it": "Aggiunto il supporto di UvLight, Longitude e Latitude",
"es": "Se agregó soporte de UvLight, Longitude y Latitude",
"pl": "Dodano obsługę UvLight, długości i szerokości geograficznej"
},
"2.1.1": {
"en": "Support of the particle concentration sensor",
"de": "Unterstützung des Partikelkonzentrationssensors",
"ru": "Поддержка датчика концентрации частиц",
"pt": "Suporte do sensor de concentração de partículas",
"nl": "Ondersteuning van de deeltjesconcentratiesensor",
"fr": "Support du capteur de concentration de particules",
"it": "Supporto del sensore di concentrazione di particelle",
"es": "Soporte del sensor de concentración de partículas",
"pl": "Wsparcie czujnika stężenia cząstek"
},
"2.1.0": {
"en": "Support of the devices control",
"de": "Unterstützung der Gerätekontrolle",
"ru": "Поддержка управления устройствами",
"pt": "Suporte do controle de dispositivos",
"nl": "Ondersteuning van de apparatencontrole",
"fr": "Prise en charge du contrôle des appareils",
"it": "Supporto del controllo dei dispositivi",
"es": "Soporte del control de dispositivos",
"pl": "Obsługa sterowania urządzeniami"
},
"2.0.2": {
"en": "Fixing re-connection of clients\nSeaPressure was added",
"de": "Reparieren der Neuverbindung von Clients\nSeaPressure wurde hinzugefügt",
"ru": "Фиксация повторного подключения клиентов\nДобавлено SeaPressure",
"pt": "Reparando conexão de clientes\nA SeaPressure foi adicionada",
"nl": "Bevestiging van opnieuw verbinden van clients\nSeaPressure is toegevoegd",
"fr": "Correction de la reconnexion des clients\nSeaPressure a été ajouté",
"it": "Risolvere la riconnessione dei client\nSeaPressure è stato aggiunto",
"es": "Reparar la reconexión de los clientes\nSeaPressure fue agregado",
"pl": "Naprawianie ponownego połączenia klientów\nSeaPressure zostało dodane"
},
"2.0.1": {
"en": "Add Light/Noise/AirQuality\nDo not send pingresp for invalid clients",
"de": "Fügen Sie den Light/Noise/AirQuality hinzu\nSendet keine Pingresp für ungültige Clients",
"ru": "Добавлены Light/Noise/AirQuality\nНе отправляen pingresp для недействительных клиентов",
"pt": "Adicionar Light/Noise/AirQuality",
"nl": "Light/Noise/AirQuality toevoegen",
"fr": "Ajouter un capteur Light/Noise/AirQuality",
"it": "Aggiungi il Light/Noise/AirQuality",
"es": "Agregar Light/Noise/AirQuality",
"pl": "Dodaj Light/Noise/AirQuality"
}
},
"title": "Sonoff", "title": "Sonoff",
"desc": { "desc": {
"en": "This adapter allows to connect sonoff components via MQTT", "en": "This adapter allows to connect sonoff components via MQTT"
"de": "Dieser Adapter ermöglicht den Anschluss von Sonoff-Komponenten über MQTT",
"ru": "Этот адаптер позволяет подключать компоненты Sonoff через MQTT",
"pt": "Este adaptador permite conectar os componentes do sonoff via MQTT",
"nl": "Met deze adapter kunnen sonoff-componenten via MQTT worden aangesloten",
"fr": "Cet adaptateur permet de connecter des composants sonoff via MQTT",
"it": "Questo adattatore consente di collegare i componenti Sonoff via MQTT",
"es": "Este adaptador permite conectar componentes de sonof a través de MQTT",
"pl": "Ten adapter umożliwia łączenie komponentów sonoff za pośrednictwem MQTT"
}, },
"authors": [ "authors": [
"bluefox <dogafox@gmail.com>" "bluefox <dogafox@gmail.com>"
@@ -134,12 +14,12 @@
"mode": "daemon", "mode": "daemon",
"compact": true, "compact": true,
"enabled": true, "enabled": true,
"readme": "https://github.com/ioBroker/ioBroker.sonoff/blob/master/README.md", "readme": "https://github.com/yunkong2/yunkong2.sonoff/blob/master/README.md",
"loglevel": "info", "loglevel": "info",
"icon": "sonoff.png", "icon": "sonoff.png",
"materialize": true, "materialize": true,
"keywords": ["ITEAD", "MQTT", "Sonoff", "Tasmota"], "keywords": ["ITEAD", "MQTT", "Sonoff", "Tasmota"],
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.sonoff/master/admin/sonoff.png", "extIcon": "https://git.spacen.net/yunkong2/yunkong2.sonoff/master/admin/sonoff.png",
"type": "lighting" "type": "lighting"
}, },
"native": { "native": {
+3 -3
View File
@@ -164,7 +164,7 @@ function MQTTServer(adapter) {
memwatch.on('leak', (info) => { memwatch.on('leak', (info) => {
//console.error('Memory leak detected:\n', info); //console.error('Memory leak detected:\n', info);
adapter.log.info('Memory leak detected:\n', info); adapter.log.info('Memory leak detected:\n', info);
var filename='/opt/iobroker/dumps/' + Date.now() + '.heapsnapshot'; var filename='/opt/yunkong2/dumps/' + Date.now() + '.heapsnapshot';
heapdump.writeSnapshot((err,filename) => { heapdump.writeSnapshot((err,filename) => {
if (err) { if (err) {
console.error(err); console.error(err);
@@ -1074,10 +1074,10 @@ function MQTTServer(adapter) {
adapter.log.info('mem: ' + state.val + ' MB'); adapter.log.info('mem: ' + state.val + ' MB');
if (heapTest==0 || (heapTest==1 && state.val>37.5)) { if (heapTest==0 || (heapTest==1 && state.val>37.5)) {
heapTest+=1; heapTest+=1;
heapdump.writeSnapshot('/opt/iobroker/' + Date.now() + '.heapsnapshot'); heapdump.writeSnapshot('/opt/yunkong2/' + Date.now() + '.heapsnapshot');
adapter.log.info('Wrote snapshot: '); adapter.log.info('Wrote snapshot: ');
var filename='/opt/iobroker/' + Date.now() + '.heapsnapshot'; var filename='/opt/yunkong2/' + Date.now() + '.heapsnapshot';
heapdump.writeSnapshot((err,filename) => { heapdump.writeSnapshot((err,filename) => {
if (err) { if (err) {
adapter.log.info('heap: ' + err); adapter.log.info('heap: ' + err);
+2 -2
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;
+1 -1
View File
@@ -5,7 +5,7 @@
/** /**
* *
* ioBroker sonoff Adapter * yunkong2 sonoff Adapter
* *
* (c) 2017-2019 bluefox * (c) 2017-2019 bluefox
* *
+7 -8
View File
@@ -1,21 +1,20 @@
{ {
"name": "iobroker.sonoff", "name": "yunkong2.sonoff",
"description": "The adapter allows to send and receive MQTT messages from ioBroker and to be a broker.", "description": "The adapter allows to send and receive MQTT messages from yunkong2 and to be a broker.",
"version": "2.2.3", "version": "2.2.3",
"author": "bluefox <dogafox@gmail.com>", "homepage": "https://github.com/yunkong2/yunkong2.sonoff",
"homepage": "https://github.com/ioBroker/ioBroker.sonoff",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/ioBroker/ioBroker.sonoff" "url": "https://github.com/yunkong2/yunkong2.sonoff"
}, },
"licenses": [ "licenses": [
{ {
"type": "MIT", "type": "MIT",
"url": "https://github.com/ioBroker/ioBroker.sonoff/blob/master/LICENSE" "url": "https://github.com/yunkong2/yunkong2.sonoff/blob/master/LICENSE"
} }
], ],
"keywords": [ "keywords": [
"iobroker", "yunkong2",
"sonoff", "sonoff",
"MQTT", "MQTT",
"tasmota", "tasmota",
@@ -33,7 +32,7 @@
"chai": "^4.1.2" "chai": "^4.1.2"
}, },
"bugs": { "bugs": {
"url": "https://github.com/ioBroker/ioBroker.sonoff/issues" "url": "https://github.com/yunkong2/yunkong2.sonoff/issues"
}, },
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -22,7 +22,7 @@ const logger = {
function Objects(cb) { function Objects(cb) {
if (!(this instanceof Objects)) return new Objects(cb); if (!(this instanceof Objects)) return new Objects(cb);
const _Objects = require(rootDir + 'tmp/node_modules/iobroker.js-controller/lib/objects'); const _Objects = require(rootDir + 'tmp/node_modules/yunkong2.js-controller/lib/objects');
this.connected = false; this.connected = false;
const that = this; const that = this;
+1 -1
View File
@@ -407,7 +407,7 @@ function clearControllerLog() {
} }
function clearDB() { function clearDB() {
const dirPath = rootDir + 'tmp/iobroker-data/sqlite'; const dirPath = rootDir + 'tmp/yunkong2-data/sqlite';
let files; let files;
try { try {
if (fs.existsSync(dirPath)) { if (fs.existsSync(dirPath)) {
+1 -1
View File
@@ -21,7 +21,7 @@ const logger = {
function States(cb, stateChange) { function States(cb, stateChange) {
const that = this; const that = this;
const _States = require(rootDir + 'tmp/node_modules/iobroker.js-controller/lib/states'); const _States = require(rootDir + 'tmp/node_modules/yunkong2.js-controller/lib/states');
let callbackId = 0; let callbackId = 0;
const options = { const options = {
+3 -3
View File
@@ -53,12 +53,12 @@ describe('Test package.json and io-package.json', () => {
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();
} }