@switchbot/homebridge-switchbot
Advanced tools
Comparing version 3.7.1-beta.22 to 3.7.1-beta.23
@@ -113,3 +113,3 @@ /* | ||
// LeakSensor | ||
if (this.device.waterdetector?.hide_leak && this.LeakSensor?.Service) { | ||
if (!this.device.waterdetector?.hide_leak && this.LeakSensor?.Service) { | ||
// StatusActive | ||
@@ -119,3 +119,3 @@ this.LeakSensor.StatusActive = this.serviceData.state; | ||
// LeakDetected | ||
if (this.device.waterdetector.dry) { | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.serviceData.status === 0 ? 1 : 0; | ||
@@ -147,4 +147,10 @@ this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
// LeakDetected | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status; | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status === 0 ? 1 : 0; | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
} | ||
else { | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status; | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
} | ||
} | ||
@@ -183,4 +189,10 @@ // BatteryLevel | ||
// LeakDetected | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState; | ||
await this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState === 0 ? 1 : 0; | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
} | ||
else { | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState; | ||
await this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`); | ||
} | ||
} | ||
@@ -187,0 +199,0 @@ // BatteryLevel |
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "3.7.1-beta.22", | ||
"version": "3.7.1-beta.23", | ||
"description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.", | ||
@@ -8,0 +8,0 @@ "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)", |
@@ -154,3 +154,3 @@ /* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved. | ||
// LeakSensor | ||
if (this.device.waterdetector?.hide_leak && this.LeakSensor?.Service) { | ||
if (!this.device.waterdetector?.hide_leak && this.LeakSensor?.Service) { | ||
// StatusActive | ||
@@ -161,3 +161,3 @@ this.LeakSensor.StatusActive = this.serviceData.state | ||
// LeakDetected | ||
if (this.device.waterdetector.dry) { | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.serviceData.status === 0 ? 1 : 0 | ||
@@ -191,4 +191,9 @@ this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
// LeakDetected | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status === 0 ? 1 : 0 | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
} else { | ||
this.LeakSensor.LeakDetected = this.deviceStatus.status | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
} | ||
} | ||
@@ -233,4 +238,9 @@ | ||
// LeakDetected | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState | ||
await this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
if (this.device.waterdetector?.dry) { | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState === 0 ? 1 : 0 | ||
this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
} else { | ||
this.LeakSensor.LeakDetected = this.webhookContext.detectionState | ||
await this.debugLog(`LeakDetected: ${this.LeakSensor.LeakDetected}`) | ||
} | ||
} | ||
@@ -237,0 +247,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3927846
45720
28
74
0
294