Skip to content

Commit

Permalink
Merge pull request #27 from rsporny/24-durationoffset-doesnt-seem-to-…
Browse files Browse the repository at this point in the history
…do-anything

issue #24: fix durationOffset
  • Loading branch information
rsporny authored Apr 7, 2022
2 parents 5462a74 + 036f11f commit c5daae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit c5daae4

Please sign in to comment.