iobroker.shelly
Advanced tools
Comparing version 0.2.4 to 0.2.5
{ | ||
"common": { | ||
"name": "shelly", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"news": { | ||
"0.2.5": { | ||
"en": "Hostname instead of ip address will be shown", | ||
"de": "Anzeige Hostname statt IP-Adresse" | ||
}, | ||
"0.2.4": { | ||
@@ -7,0 +11,0 @@ "en": "Channel name can be overwrite with own name", |
{ | ||
"name": "iobroker.shelly", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Shelly", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -40,4 +40,7 @@ ![Logo](admin/shelly.png) | ||
### 0.2.5 (13.10.2018) | ||
* Hostname instead of ip address will be shown | ||
### 0.2.4 (10.10.2018) | ||
* Channel name can be overwrite with own name | ||
* Channel name can be overwrite with own name | ||
@@ -44,0 +47,0 @@ ### 0.2.3 (01.10.2018) |
@@ -9,2 +9,3 @@ /* jshint -W097 */ | ||
// you have to require the utils module and call adapter function | ||
const dns = require('dns'); | ||
const utils = require(__dirname + '/lib/utils'); // Get common adapter utils | ||
@@ -330,3 +331,10 @@ const adapter = new utils.Adapter('shelly'); | ||
// call once at start | ||
controlFunction(value || 0); | ||
let sen = getSensorIoBrokerIDs(deviceId, s.I); | ||
adapter.getState(sen.id, function(err, state) { | ||
if (!err && state) { | ||
controlFunction(state.val); | ||
} else { | ||
controlFunction(value || 0); | ||
} | ||
}); | ||
} | ||
@@ -459,3 +467,3 @@ if (b && b.D.startsWith('Shutter') && s.T === 'ShutterUp') { | ||
} | ||
}, value, controlFunction); | ||
}, ['name'], value, controlFunction); | ||
} | ||
@@ -487,14 +495,19 @@ } | ||
}, true); | ||
adapter.log.debug('Create state object for ' + deviceId + '.hostname' + ' if not exist'); | ||
objectHelper.setOrUpdateObject(deviceId + '.hostname', { | ||
type: 'state', | ||
common: { | ||
name: 'Device hostname', | ||
type: 'string', | ||
role: 'info.ip', | ||
read: true, | ||
write: false | ||
} | ||
}, ip); | ||
// get hostname for ip adresss | ||
dns.reverse(ip, function(err, hostnames) { | ||
let hostname = (!err && hostnames.length > 0) ? hostnames[0] : ip; | ||
adapter.log.debug('Create state object for ' + deviceId + '.hostname' + ' if not exist'); | ||
objectHelper.setOrUpdateObject(deviceId + '.hostname', { | ||
type: 'state', | ||
common: { | ||
name: 'Device hostname', | ||
type: 'string', | ||
role: 'info.ip', | ||
read: true, | ||
write: false | ||
} | ||
}, hostname); | ||
}); | ||
if (description) { | ||
@@ -501,0 +514,0 @@ let blk = description.blk || []; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
230155
1381
87
1