Merge pull request #10 from Sebastian-Maier/fix_angle

Fix angle translation/calculation (for inverted angles)
This commit is contained in:
Serge Wagener 2020-10-20 14:33:31 +02:00 committed by GitHub
commit 003f2d8513
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,7 @@ SmartHomeNGAccessory.prototype = {
var callback = function (shngitem, value, inverted) { var callback = function (shngitem, value, inverted) {
//this.log("[" + this.name + "] callback for " + characteristic.displayName); //this.log("[" + this.name + "] callback for " + characteristic.displayName);
value = value * 3.6; value = value * 3.6;
characteristic.setValue(inverted ? 100 - value : value, undefined, 'fromSHNG'); characteristic.setValue(inverted ? 360 - value : value, undefined, 'fromSHNG');
}.bind(this); }.bind(this);
monitoring.push({name: name, characteristic: characteristic.displayName, item: shngitem, callback: callback, inverted: inverted}); monitoring.push({name: name, characteristic: characteristic.displayName, item: shngitem, callback: callback, inverted: inverted});
}, },