From 036f11f0e0c7a97d5093348b93e703bdc40eff7b Mon Sep 17 00:00:00 2001 From: Radoslaw Sporny Date: Thu, 7 Apr 2022 12:22:57 +0200 Subject: [PATCH] issue #24: fix durationOffset --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0fa1348..dff8ca4 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ function BlindsAccessory(log, config) { this.infoService .setCharacteristic(Characteristic.Manufacturer, 'Radoslaw Sporny') .setCharacteristic(Characteristic.Model, 'RaspberryPi GPIO Blinds') - .setCharacteristic(Characteristic.SerialNumber, 'Version 1.1.2'); + .setCharacteristic(Characteristic.SerialNumber, 'Version 1.1.4'); this.finalBlindsStateTimeout; this.togglePinTimeout; @@ -159,7 +159,7 @@ BlindsAccessory.prototype.setTargetPosition = function(position, callback) { BlindsAccessory.prototype.togglePin = function(pin, duration) { if (rpio.read(pin) != this.activeState) rpio.write(pin, this.activeState); - if (this.durationOffset && (this.targetPosition == 0 || this.targetPosition == 100)) this.duration += this.durationOffset; + if (this.durationOffset && (this.targetPosition == 0 || this.targetPosition == 100)) duration += this.durationOffset; this.togglePinTimeout = setTimeout(function() { rpio.write(pin, this.initialState); }.bind(this), parseInt(duration)); diff --git a/package.json b/package.json index c79ab1e..72e2d59 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-gpio-blinds", - "version": "1.1.3", + "version": "1.1.4", "description": "Homebridge plugin to control blinds via Raspberry Pi GPIO pins", "license": "MIT", "keywords": [