Skip to content

Commit

Permalink
fix: breaking don't invert windowcoverings_set
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinBol committed Mar 16, 2023
1 parent c5bbc7a commit 9edeb27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/system/capabilities/windowcoverings_set/windowCovering.js
Expand Up @@ -50,7 +50,7 @@ module.exports = {
await this.setCapabilityValue('windowcoverings_set', value);
return null;
}
const mappedValue = mapValueRange(0, 1, 100, 0, value);
const mappedValue = mapValueRange(0, 1, 0, 100, value);
const gotToLiftPercentageCommand = {
// Round, otherwise might not be accepted by device
percentageLiftValue: Math.round(mappedValue),
Expand All @@ -69,7 +69,7 @@ module.exports = {
if (value < 0 || value > 100) return null;

// Parse input value
const parsedValue = mapValueRange(0, 100, 1, 0, value);
const parsedValue = mapValueRange(0, 100, 0, 1, value);

// Refresh timer if needed
if (this._reportPercentageDebounce) {
Expand Down

0 comments on commit 9edeb27

Please sign in to comment.