Skip to content

Commit

Permalink
Update device.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Aug 1, 2024
1 parent 0672e88 commit e7a7dcb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/devices/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ export abstract class deviceBase {
await this.debugLog(`${CharacteristicName}: ${CharacteristicValue}`);
} else {
Service.updateCharacteristic(Characteristic, CharacteristicValue);
await this.debugLog(`updateCharacteristic ${CharacteristicName}: ${CharacteristicValue}`);
await this.debugLog(`updateCharacteristic ${CharacteristicName}: ${CharacteristicValue}`
+ ` (${CharacteristicValue === Value ? StatusMatch : StatusDoesNotMatch})`);
await this.debugWarnLog(`context before: ${this.accessory.context[ServiceName[CharacteristicName]]}`);
if ((this.accessory.context[ServiceName[CharacteristicName]] !== CharacteristicValue) && StatusMatch && StatusDoesNotMatch) {
await this.infoLog(`was ${CharacteristicValue === Value ? StatusMatch : StatusDoesNotMatch}`);
}
const contextBefore = this.accessory.context[ServiceName[CharacteristicName]];
this.accessory.context[ServiceName[CharacteristicName]] = CharacteristicValue;
await this.debugWarnLog(`context after: ${this.accessory.context[ServiceName[CharacteristicName]]}`);
if ((contextBefore !== this.accessory.context[ServiceName[CharacteristicName]]) && StatusMatch && StatusDoesNotMatch) {
await this.infoLog(`was ${CharacteristicValue === Value ? StatusMatch : StatusDoesNotMatch}`);
}
}
}

Expand Down

0 comments on commit e7a7dcb

Please sign in to comment.