diff --git a/package-lock.json b/package-lock.json index 286abdf..5d5b148 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "homebridge-blaq", - "version": "0.2.26", + "version": "0.2.27", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebridge-blaq", - "version": "0.2.26", + "version": "0.2.27", "funding": [ { "type": "github", diff --git a/package.json b/package.json index 29e821f..9196f78 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": false, "displayName": "Konnected BlaQ", "name": "homebridge-blaq", - "version": "0.2.26", + "version": "0.2.27", "description": "Control and view your garage door(s) remotely with real-time updates using Konnected's BlaQ hardware", "license": "Apache-2.0", "type": "module", diff --git a/src/accessory/garage-door.ts b/src/accessory/garage-door.ts index 970329e..9f65031 100644 --- a/src/accessory/garage-door.ts +++ b/src/accessory/garage-door.ts @@ -147,11 +147,11 @@ export class BlaQGarageDoorAccessory extends BaseBlaQAccessory { return this.platform.characteristic.CurrentDoorState.OPENING; } else if (this.state === 'OPEN' || (this.position !== undefined && this.position > 0)) { const openReason = this.state === 'OPEN' ? 'the current state is OPEN' : 'the current position is greater than zero'; - this.logger.debug(`Returning current state OPENING because: ${openReason}`); + this.logger.debug(`Returning current state OPEN because: ${openReason}`); return this.platform.characteristic.CurrentDoorState.OPEN; } else if (this.state === 'CLOSED' || (this.position !== undefined && this.position <= 0)) { const closedReason = this.state === 'CLOSED' ? 'the current state is CLOSED' : 'the current position is less than or equal to zero'; - this.logger.debug(`Returning current state OPENING because: ${closedReason}`); + this.logger.debug(`Returning current state CLOSED because: ${closedReason}`); return this.platform.characteristic.CurrentDoorState.CLOSED; } throw new Error(`Invalid door state: ${this.state}`); @@ -253,10 +253,11 @@ export class BlaQGarageDoorAccessory extends BaseBlaQAccessory { this.logger.debug('Returning target state CLOSED because: current operation is IDLE and current state is CLOSED'); return this.platform.characteristic.TargetDoorState.CLOSED; }else if(this.state === 'OPEN'){ - this.logger.debug('Returning target state CLOSED because: current operation is IDLE and current state is OPEN'); + this.logger.debug('Returning target state OPEN because: current operation is IDLE and current state is OPEN'); return this.platform.characteristic.TargetDoorState.OPEN; } } + this.logger.debug('Returning target state CLOSED because: no other conditions matched'); return this.platform.characteristic.TargetDoorState.CLOSED; // throw new Error(`Invalid target door state: ${this.currentOperation}`); }