@switchbot/homebridge-switchbot
Advanced tools
Comparing version 3.7.1-beta.5 to 3.7.1-beta.6
{ | ||
"displayName": "SwitchBot", | ||
"name": "@switchbot/homebridge-switchbot", | ||
"version": "3.7.1-beta.5", | ||
"version": "3.7.1-beta.6", | ||
"description": "The SwitchBot plugin allows you to access your SwitchBot device(s) from HomeKit.", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -818,54 +818,51 @@ /* Copyright(C) 2021-2024, donavanbecker (https://github.com/donavanbecker). All rights reserved. | ||
async OnSet(value: CharacteristicValue): Promise<void> { | ||
if (this.botDeviceType === 'switch') { | ||
if (this.Switch) { | ||
await this.debugLog(`Set On: ${value}`); | ||
this.On = value === false ? false : true; | ||
if (this.botDeviceType === 'garagedoor') { | ||
this.debugLog(`Set TargetDoorState: ${value}`); | ||
if (value === this.hap.Characteristic.TargetDoorState.CLOSED) { | ||
this.On = false; | ||
} else { | ||
this.On = true; | ||
} | ||
} else if (this.botDeviceType === 'garagedoor') { | ||
if (this.GarageDoor) { | ||
await this.debugLog(`Set TargetDoorState: ${value}`); | ||
this.On = value === this.hap.Characteristic.TargetDoorState.CLOSED ? false : true; | ||
} else if ( | ||
this.botDeviceType === 'door' || | ||
this.botDeviceType === 'window' || | ||
this.botDeviceType === 'windowcovering' | ||
) { | ||
this.debugLog(`Set TargetPosition: ${value}`); | ||
if (value === 0) { | ||
this.On = false; | ||
} else { | ||
this.On = true; | ||
} | ||
} else if (this.botDeviceType === 'door') { | ||
if (this.Door) { | ||
await this.debugLog(`Set TargetPosition: ${value}`); | ||
this.On = value === 0 ? false : true; | ||
} | ||
} else if (this.botDeviceType === 'window') { | ||
if (this.Window) { | ||
await this.debugLog(`Set TargetPosition: ${value}`); | ||
this.On = value === 0 ? false : true; | ||
} | ||
} else if (this.botDeviceType === 'windowcovering') { | ||
if (this.WindowCovering) { | ||
await this.debugLog(`Set TargetPosition: ${value}`); | ||
this.On = value === 0 ? false : true; | ||
} | ||
} else if (this.botDeviceType === 'lock') { | ||
if (this.LockMechanism) { | ||
await this.debugLog(`Set LockTargetState: ${value}`); | ||
this.On = value === this.hap.Characteristic.LockTargetState.SECURED ? false : true; | ||
this.debugLog(`Set LockTargetState: ${value}`); | ||
if (value === this.hap.Characteristic.LockTargetState.SECURED) { | ||
this.On = false; | ||
} else { | ||
this.On = true; | ||
} | ||
} else if (this.botDeviceType === 'faucet') { | ||
if (this.Faucet) { | ||
await this.debugLog(`Set Active: ${value}`); | ||
this.On = value === this.hap.Characteristic.Active.INACTIVE ? false : true; | ||
this.debugLog(`Set Active: ${value}`); | ||
if (value === this.hap.Characteristic.Active.INACTIVE) { | ||
this.On = false; | ||
} else { | ||
this.On = true; | ||
} | ||
} else if (this.botDeviceType === 'stateful') { | ||
if (this.StatefulProgrammableSwitch) { | ||
await this.debugLog(`Set ProgrammableSwitchOutputState: ${value}`); | ||
this.On = value === 0 ? false : true; | ||
this.debugLog(`Set ProgrammableSwitchOutputState: ${value}`); | ||
if (value === 0) { | ||
this.On = false; | ||
} else { | ||
this.On = true; | ||
} | ||
} else { | ||
if (this.Outlet) { | ||
await this.debugLog(`Set On: ${value}`); | ||
this.On = value === false ? false : true; | ||
this.debugLog(`Set On: ${value}`); | ||
if (this.device.bot?.mode === 'multipress') { | ||
if (value === true) { | ||
this.multiPressCount++; | ||
this.debugLog(`set to Multi-Press. Multi-Press count: ${this.multiPressCount}`); | ||
} | ||
} | ||
this.On = value as boolean; | ||
} | ||
if (this.device.bot?.mode === 'multipress') { | ||
if (this.On === true) { | ||
this.multiPressCount++; | ||
await this.debugLog(`multiPressCount: ${this.multiPressCount}`); | ||
} | ||
} | ||
this.doBotUpdate.next(); | ||
@@ -872,0 +869,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
3236650
43998