Skip to content

Commit

Permalink
Update target door state fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleBoyer committed Jul 15, 2024
1 parent e274b02 commit 9449b3e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": false,
"displayName": "Konnected BlaQ",
"name": "homebridge-blaq",
"version": "0.2.14",
"version": "0.2.15",
"description": "Control and view your garage door(s) remotely with real-time updates using Konnected's BlaQ hardware",
"license": "Apache-2.0",
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions src/accessory/garage-door.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ export class BlaQGarageDoorAccessory implements BaseBlaQAccessory {
}

getTargetDoorState(): CharacteristicValue {
if(this.currentOperation === 'OPENING' || (this.targetPosition !== undefined && this.targetPosition > 0)){
return this.platform.characteristic.TargetDoorState.OPEN;
} else if(this.currentOperation === 'CLOSING' || this.preClosing || (this.targetPosition !== undefined && this.targetPosition <= 0)){
if(this.currentOperation === 'CLOSING' || this.preClosing || (this.targetPosition !== undefined && this.targetPosition <= 0)){
return this.platform.characteristic.TargetDoorState.CLOSED;
} else if(this.currentOperation === 'OPENING' || (this.targetPosition !== undefined && this.targetPosition > 0)){
return this.platform.characteristic.TargetDoorState.OPEN;
} else if(this.currentOperation === 'IDLE'){
if(this.state === 'CLOSED'){
return this.platform.characteristic.TargetDoorState.CLOSED;
Expand Down Expand Up @@ -406,7 +406,7 @@ export class BlaQGarageDoorAccessory implements BaseBlaQAccessory {
this.setPreClosing(true);
setTimeout(() => {
this.setPreClosing(false);
}, warningDuration);
}, warningDuration + 100); // add 100ms for closing state to happen right after
}
} catch(e) {
this.logger.error('Log parsing error:', e);
Expand Down

0 comments on commit 9449b3e

Please sign in to comment.