iobroker.shelly
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -0,3 +1,39 @@ | ||
'use strict'; | ||
module.exports = { | ||
"extends": "airbnb-base" | ||
}; | ||
'extends': ['eslint:recommended', 'plugin:react/recommended'], | ||
'parserOptions': { | ||
'ecmaVersion': 8, | ||
'ecmaFeatures': { | ||
'experimentalObjectRestSpread': true, | ||
'jsx': true | ||
}, | ||
'sourceType': 'module' | ||
}, | ||
'env': { | ||
'node': true, | ||
'es6': true | ||
}, | ||
'rules': { | ||
'no-console': ['warn'], | ||
'no-undef': ['error'], | ||
'no-unused-vars': ['warn'], | ||
'one-var': 'off', | ||
'arrow-parens': ['error', 'always'], | ||
'semi': ['error', 'always'], | ||
'indent': ['error', 2, { | ||
'SwitchCase': 1 | ||
}], | ||
'max-len': [ | ||
'warn', | ||
{ | ||
'code': 200, | ||
'ignoreTemplateLiterals': true, | ||
'ignoreStrings': true | ||
} | ||
], | ||
'generator-star-spacing': 'off', | ||
'func-names': ['error', 'never'], | ||
'quotes': ['error', 'single'] | ||
} | ||
} |
{ | ||
"common": { | ||
"name": "shelly", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"news": { | ||
"2.0.7": { | ||
"en": "Bugfixing for objects AutoTimerOn and AutoTimeroff", | ||
"de": "Fehlerbehbung der Objekte AutoTimerOn und AutoTimeroff" | ||
}, | ||
"2.0.6": { | ||
@@ -121,3 +125,8 @@ "en": "Getting faster online status for Shelly devices, excluded H&T", | ||
"extIcon": "https://raw.githubusercontent.com/schmupu/ioBroker.shelly/master/admin/shelly.png", | ||
"keywords": ["shelly", "switch", "smarthome", "iobroker"], | ||
"keywords": [ | ||
"shelly", | ||
"switch", | ||
"smarthome", | ||
"iobroker" | ||
], | ||
"readme": "https://github.com/schmupu/ioBroker.shelly/blob/master/README.md", | ||
@@ -133,9 +142,12 @@ "loglevel": "info", | ||
"polltime": 10, | ||
"keys": [{ | ||
"hosts": "", | ||
"devids": "" | ||
}] | ||
"keys": [ | ||
{ | ||
"hosts": "", | ||
"devids": "" | ||
} | ||
] | ||
}, | ||
"objects": [], | ||
"instanceObjects": [{ | ||
"instanceObjects": [ | ||
{ | ||
"_id": "info", | ||
@@ -162,2 +174,2 @@ "type": "channel", | ||
] | ||
} | ||
} |
{ | ||
"name": "iobroker.shelly", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "Shelly", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -41,6 +41,9 @@ ![Logo](admin/shelly.png) | ||
### 2.0.6 (12.01.2018) | ||
### 2.0.7 (21.01.2019) | ||
* Bugfixing for objects AutoTimerOn and AutoTimeroff | ||
### 2.0.6 (12.01.2019) | ||
* Getting faster online status for Shelly devices, excluded H&T. Fix of power status for Shelly Plug. | ||
### 2.0.5 (07.01.2018) | ||
### 2.0.5 (07.01.2019) | ||
* Fixing an error if Shelly device is not reachable (offline) | ||
@@ -47,0 +50,0 @@ |
@@ -77,3 +77,2 @@ /* jshint -W097 */ | ||
main(); | ||
isShellyOnine(); | ||
}); | ||
@@ -180,3 +179,3 @@ }); | ||
function createChannel(deviceId, state) { | ||
@@ -186,3 +185,3 @@ let arr = state.split('.'); | ||
let channelId = deviceId + '.' + arr[0]; | ||
adapter.log.debug("Creating Channel " + channelId); | ||
adapter.log.debug('Creating Channel ' + channelId); | ||
objectHelper.setOrUpdateObject(channelId, { | ||
@@ -198,3 +197,3 @@ type: 'channel', | ||
function createDevice(deviceId, description, ip) { | ||
adapter.log.debug("Creating device " + deviceId); | ||
adapter.log.debug('Creating device ' + deviceId); | ||
objectHelper.setOrUpdateObject(deviceId, { | ||
@@ -347,3 +346,3 @@ type: 'device', | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -361,3 +360,3 @@ }); | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -374,3 +373,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -384,3 +383,3 @@ }; | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -545,3 +544,3 @@ type: 'state', | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -590,3 +589,3 @@ }); | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/roller/0', params); | ||
@@ -615,3 +614,3 @@ }); | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/roller/0', params); | ||
@@ -630,3 +629,3 @@ }); | ||
}; | ||
adapter.log.debug("RollerPosition: " + JSON.stringify(params)); | ||
adapter.log.debug('RollerPosition: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/roller/0', params); | ||
@@ -638,3 +637,3 @@ }; | ||
const relayId = parseInt(i.substr(5), 10); | ||
controlFunction = (value) => (value) => { | ||
controlFunction = (value) => { | ||
let params; | ||
@@ -644,3 +643,3 @@ params = { | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -657,3 +656,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -664,3 +663,3 @@ }; | ||
if (i == 'mode') { | ||
controlFunction = (value) => (value) => { | ||
controlFunction = (value) => { | ||
let params; | ||
@@ -670,3 +669,3 @@ params = { | ||
}; | ||
adapter.log.debug("Modus: " + JSON.stringify(params)); | ||
adapter.log.debug('Modus: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings', params); // send REST call to devices IP with the given path and parameters | ||
@@ -684,3 +683,3 @@ }; | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -773,3 +772,3 @@ type: 'state', | ||
break; | ||
case 'rollers."maxtime': | ||
case 'rollers.maxtime': | ||
id = 'Shutter.Duration'; | ||
@@ -886,3 +885,3 @@ break; | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -900,3 +899,3 @@ }); | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -913,3 +912,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -923,3 +922,3 @@ }; | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -1135,3 +1134,3 @@ type: 'state', | ||
} | ||
adapter.log.debug("Relay: " + JSON.stringify(params)); | ||
adapter.log.debug('Relay: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -1149,3 +1148,3 @@ }); | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -1162,3 +1161,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/relay/' + relayId, params); // send REST call to devices IP with the given path and parameters | ||
@@ -1172,3 +1171,3 @@ }; | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -1304,3 +1303,3 @@ type: 'state', | ||
} | ||
adapter.log.debug("Lights Switch: " + JSON.stringify(params)); | ||
adapter.log.debug('Lights Switch: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/light/0', params); // send REST call to devices IP with the given path and parameters | ||
@@ -1316,3 +1315,3 @@ }); | ||
params[id] = value; | ||
adapter.log.debug("Set Colors: " + JSON.stringify(params)); | ||
adapter.log.debug('Set Colors: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/light/0', params); // send REST call to devices IP with the given path and parameters | ||
@@ -1328,3 +1327,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/light/0', params); // send REST call to devices IP with the given path and parameters | ||
@@ -1340,3 +1339,3 @@ }; | ||
}; | ||
adapter.log.debug("Auto Timer off: " + JSON.stringify(params)); | ||
adapter.log.debug('Auto Timer off: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings/light/0', params); // send REST call to devices IP with the given path and parameters | ||
@@ -1352,3 +1351,3 @@ }; | ||
}; | ||
adapter.log.debug("Modus: " + JSON.stringify(params)); | ||
adapter.log.debug('Modus: ' + JSON.stringify(params)); | ||
shelly.callDevice(deviceId, '/settings', params); // send REST call to devices IP with the given path and parameters | ||
@@ -1362,3 +1361,3 @@ }; | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -1472,3 +1471,3 @@ type: 'state', | ||
adapter.log.debug("Creating State " + stateId); | ||
adapter.log.debug('Creating State ' + stateId); | ||
objectHelper.setOrUpdateObject(stateId, { | ||
@@ -1570,3 +1569,3 @@ type: 'state', | ||
if (!error && data) { | ||
adapter.log.debug("New Device Settings for " + deviceId + " : " + JSON.stringify(data)); | ||
adapter.log.debug('New Device Settings for ' + deviceId + ' : ' + JSON.stringify(data)); | ||
} | ||
@@ -1577,3 +1576,3 @@ }); | ||
if (!error && data) { | ||
adapter.log.debug("New Device Status for " + deviceId + " : " + JSON.stringify(data)); | ||
adapter.log.debug('New Device Status for ' + deviceId + ' : ' + JSON.stringify(data)); | ||
} | ||
@@ -1584,13 +1583,2 @@ }); | ||
function isShellyOnine() { | ||
adapter.getAdapterObjects((obj) => { | ||
for (let id in obj) { | ||
if (id.endsWith('.online') && obj[id].type == 'state') { | ||
} | ||
} | ||
}); | ||
} | ||
// ******************************************************************************* | ||
@@ -1652,3 +1640,3 @@ // | ||
adapter.log.info("Starting " + adapter.namespace + " in version " + adapter.version); | ||
adapter.log.info('Starting ' + adapter.namespace + ' in version ' + adapter.version); | ||
objectHelper.init(adapter); | ||
@@ -1736,3 +1724,3 @@ setConnected(false); | ||
// If started as allInOne mode => return function to create instance | ||
if (typeof module !== "undefined" && module.parent) { | ||
if (typeof module !== 'undefined' && module.parent) { | ||
module.exports = startAdapter; | ||
@@ -1739,0 +1727,0 @@ } else { |
Sorry, the diff of this file is not supported yet
267967
2518
121