Skip to content

Commit

Permalink
Update waterdetector.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
donavanbecker committed Nov 5, 2024
1 parent bc9576a commit d65a396
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/device/waterdetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ export class WaterDetector extends deviceBase {
// LeakSensor
if (!(this.device as waterDetectorConfig).hide_leak && this.LeakSensor?.Service) {
// StatusActive
this.LeakSensor.StatusActive = this.serviceData.leak
this.LeakSensor.StatusActive = this.serviceData.tampered
this.debugLog(`StatusActive: ${this.LeakSensor.StatusActive}`)

// LeakDetected
this.LeakSensor.LeakDetected = (this.device as waterDetectorConfig).dry
? !this.serviceData.tampered ? this.hap.Characteristic.LeakDetected.LEAK_DETECTED : this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED
: this.serviceData.tampered ? this.hap.Characteristic.LeakDetected.LEAK_DETECTED : this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED
? !this.serviceData.leak ? this.hap.Characteristic.LeakDetected.LEAK_DETECTED : this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED
: this.serviceData.leak ? this.hap.Characteristic.LeakDetected.LEAK_DETECTED : this.hap.Characteristic.LeakDetected.LEAK_NOT_DETECTED
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`)
}
// BatteryLevel
Expand Down

0 comments on commit d65a396

Please sign in to comment.