iobroker.shelly
Advanced tools
Comparing version 2.0.5 to 2.0.6
{ | ||
"common": { | ||
"name": "shelly", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"news": { | ||
"2.0.6": { | ||
"en": "Getting faster online status for Shelly devices, excluded H&T", | ||
"de": "Schnellere Ermittlung des Online Status" | ||
}, | ||
"2.0.5": { | ||
@@ -7,0 +11,0 @@ "en": "Fixing an error if Shelly device is not reachable (offline)", |
{ | ||
"name": "iobroker.shelly", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Shelly", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -41,2 +41,5 @@ ![Logo](admin/shelly.png) | ||
### 2.0.6 (12.01.2018) | ||
* Getting faster online status for Shelly devices, excluded H&T. Fix of power status for Shelly Plug. | ||
### 2.0.5 (07.01.2018) | ||
@@ -43,0 +46,0 @@ * Fixing an error if Shelly device is not reachable (offline) |
@@ -115,3 +115,13 @@ /* jshint -W097 */ | ||
function setOnlineStatus(deviceId, value) { | ||
let stateId = deviceId + '.online'; | ||
if (shellyStates[stateId] !== value) { | ||
shellyStates[stateId] = value; | ||
objectHelper.setOrUpdateObject(stateId, { | ||
type: 'state' | ||
}, ['name'], value); | ||
} | ||
} | ||
function getDeviceIdFromIoBrokerId(iobrokerId) { | ||
@@ -413,3 +423,2 @@ let deviceId; | ||
shelly.callDevice(deviceId, '/settings', parameter, (error, data) => { | ||
@@ -485,2 +494,5 @@ if (!error && data) { | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
@@ -773,2 +785,5 @@ callback && callback(); | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
@@ -813,2 +828,5 @@ | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
@@ -1053,6 +1071,9 @@ callback && callback(); | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
callback && callback(); | ||
}); | ||
// callback && callback(); | ||
}); | ||
@@ -1164,3 +1185,3 @@ | ||
break; | ||
case 'meters0.power': | ||
case 'meters.power': | ||
id = 'Relay0.Power'; | ||
@@ -1218,2 +1239,5 @@ break; | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
@@ -1397,2 +1421,5 @@ callback && callback(); | ||
} | ||
setOnlineStatus(deviceId, true); | ||
} else { | ||
setOnlineStatus(deviceId, false); | ||
} | ||
@@ -1588,3 +1615,5 @@ callback && callback(); | ||
updateShellyStates(deviceId, () => { | ||
setTimeout(pollStates, polltime * 1000, deviceId); | ||
objectHelper.processObjectQueue(() => { | ||
setTimeout(pollStates, polltime * 1000, deviceId); | ||
}); | ||
}); | ||
@@ -1591,0 +1620,0 @@ } |
266950
2492
118