andig / fritzapi

Home automation API for Fritz!Box, Fritz!DECT and FRITZ!Powerline devices
MIT License
139 stars 27 forks source link

Issues in function setLevelPercentage #47

Closed Ersthelfer closed 3 years ago

Ersthelfer commented 3 years ago

It looks like the is an issues in the function setLevelPercentage

// Dimm the device, allowed values are 0 - 100 module.exports.setLevelPercentage = function(sid, ain, levelInPercent, options) { return executeCommand(sid, 'setlevelpercentage&level=' + level2api(level,true), ain, options).then(function(body) { // api does not return a value return level; }); };

I think the call

level2api(level....

must be

level2api(levelInPercent...

// Dimm the device, allowed values are 0 - 100 module.exports.setLevelPercentage = function(sid, ain, levelInPercent, options) { return executeCommand(sid, 'setlevelpercentage&level=' + level2api(levelInPercent,true), ain, options).then(function(body) { // api does not return a value return level; }); };