diff --git a/index.js b/index.js index 69c2017..6f925bf 100755 --- a/index.js +++ b/index.js @@ -4612,7 +4612,7 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i for (const cmd of cmdList) { if (cmd.generic_type == 'FLAP_STATE' && cmd.id == service.cmd_id) { returnValue = parseInt(cmd.currentValue); - returnValue = Math.ceil(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); + returnValue = Math.floor(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); if(service.maxValue == 100) { returnValue = returnValue > (service.maxValue-5) ? service.maxValue : returnValue; // >95% is 100% in home (flaps need yearly tunning) @@ -4625,7 +4625,7 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i } if (cmd.generic_type == 'FLAP_STATE_CLOSING' && cmd.id == service.cmd_id) { returnValue = parseInt(cmd.currentValue); - returnValue = Math.ceil(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); + returnValue = Math.floor(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); if(service.maxValue == 100) { returnValue = returnValue > (service.maxValue-5) ? service.maxValue : returnValue; // >95% is 100% in home (flaps need yearly tunning) @@ -4639,7 +4639,7 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i } if (cmd.generic_type == 'WINDOW_STATE' && cmd.id == service.cmd_id) { returnValue = parseInt(cmd.currentValue); - returnValue = Math.ceil(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); + returnValue = Math.floor(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); if(Math.abs(returnValue - service.TargetValue) <= 1) {service.Moving=Characteristic.PositionState.STOPPED;} else if (service.TargetValue !== undefined && service.Moving===Characteristic.PositionState.STOPPED) {service.TargetValue=undefined;} @@ -4651,7 +4651,7 @@ JeedomPlatform.prototype.getAccessoryValue = function(characteristic, service, i case Characteristic.TargetPosition.UUID : if(service.TargetValue === undefined) { returnValue = parseInt(service.infos.state.currentValue); - returnValue = Math.ceil(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); + returnValue = Math.floor(((returnValue-service.minValue) / (service.maxValue-service.minValue))*100); if(service.maxValue == 100) { returnValue = returnValue > (service.maxValue-5) ? service.maxValue : returnValue; // >95% is 100% in home (flaps need yearly tunning)