Skip to content

Commit

Permalink
Configrable initialDelay for window-covering
Browse files Browse the repository at this point in the history
  • Loading branch information
lprhodes committed Apr 25, 2017
1 parent d603cb4 commit c597a90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions accessories/windowCovering.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {

async setTargetPosition (hexData, previousValue) {
const { config, data, log, name, state } = this;
const { initialDelay } = config;
const { stop } = data;
let { initialDelay } = config;

if (!initialDelay) initialDelay = 1;

if (state.targetPosition === previousValue) return;

Expand All @@ -27,7 +29,7 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {

this.initialDelayTimeout = setTimeout(() => {
this.performSetTargetPosition(hexData, previousValue);
}, 1000);
}, initialDelay * 1000);
}

async performSetTargetPosition (hexData, previousValue) {
Expand Down

0 comments on commit c597a90

Please sign in to comment.