diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a663073..4e360ea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/) +## [Version 1.6.3](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.6.3) (2022-01-03) + +## What's Changed +* Quick Fix for for issue not tested in `v1.6.2`. + +**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.6.2...v1.6.3 + ## [Version 1.6.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.6.2) (2022-01-03) ## What's Changed diff --git a/package-lock.json b/package-lock.json index 1cc59951..e8f51f66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@switchbot/homebridge-switchbot", - "version": "1.6.2", + "version": "1.6.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@switchbot/homebridge-switchbot", - "version": "1.6.2", + "version": "1.6.3", "funding": [ { "type": "Paypal", diff --git a/package.json b/package.json index 052a7f79..52f41bf8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Homebridge SwitchBot", "name": "@switchbot/homebridge-switchbot", - "version": "1.6.2", + "version": "1.6.3", "description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.", "author": "SwitchBot (https://github.com/SwitchBot)", "license": "ISC", diff --git a/src/devices/bots.ts b/src/devices/bots.ts index b5d3b77d..378a6d53 100644 --- a/src/devices/bots.ts +++ b/src/devices/bots.ts @@ -335,8 +335,7 @@ export class Bot { // Convert to BLE Address const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Bot: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 'H', id: this.device.bleMac, @@ -447,8 +446,7 @@ export class Bot { if (this.On !== this.OnCached) { this.debugLog(`Bot: ${this.accessory.displayName} BLE pushChanges`); const switchbot = this.connectBLE(); - this.debugLog(`Bot: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { if (this.botMode === 'press') { this.debugLog(`Bot: ${this.accessory.displayName} Bot Mode: ${this.botMode}`); switchbot.discover({ model: 'H', quick: true, id: this.device.bleMac }) diff --git a/src/devices/contact.ts b/src/devices/contact.ts index 828aa74f..5f6b5f26 100644 --- a/src/devices/contact.ts +++ b/src/devices/contact.ts @@ -286,8 +286,7 @@ export class Contact { // eslint-disable-next-line @typescript-eslint/no-var-requires const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Contact Sensor: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 'd', id: this.device.bleMac, diff --git a/src/devices/curtains.ts b/src/devices/curtains.ts index 8ef195c4..663ac38e 100644 --- a/src/devices/curtains.ts +++ b/src/devices/curtains.ts @@ -454,8 +454,7 @@ export class Curtain { // eslint-disable-next-line @typescript-eslint/no-var-requires const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Curtain: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 'c', id: this.device.bleMac, @@ -564,8 +563,7 @@ export class Curtain { if (this.TargetPosition !== this.CurrentPosition) { this.debugLog(`Curtain: ${this.accessory.displayName} BLE pushChanges`); const switchbot = this.connectBLE(); - this.debugLog(`Curtain: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.discover({ model: 'c', quick: true, id: this.device.bleMac }).then((device_list) => { this.infoLog(`${this.accessory.displayName} Target Position: ${this.TargetPosition}`); return device_list[0].runToPos(100 - Number(this.TargetPosition)); diff --git a/src/devices/humidifiers.ts b/src/devices/humidifiers.ts index 3f26a706..d10f32ba 100644 --- a/src/devices/humidifiers.ts +++ b/src/devices/humidifiers.ts @@ -352,8 +352,7 @@ export class Humidifier { // eslint-disable-next-line @typescript-eslint/no-var-requires const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Humidifier: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 'e', id: this.device.bleMac, @@ -463,8 +462,7 @@ export class Humidifier { private async BLEpushChanges() { this.debugLog(`Humidifier: ${this.accessory.displayName} BLE pushChanges`); const switchbot = this.connectBLE(); - this.debugLog(`Humidifier: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.discover({ model: 'e', quick: true, id: this.device.bleMac }).then((device_list) => { this.infoLog(`${this.accessory.displayName} Target Position: ${this.Active}`); return device_list[0].percentage(this.RelativeHumidityHumidifierThreshold); diff --git a/src/devices/meters.ts b/src/devices/meters.ts index d14516d5..cd349604 100644 --- a/src/devices/meters.ts +++ b/src/devices/meters.ts @@ -317,8 +317,7 @@ export class Meter { // eslint-disable-next-line @typescript-eslint/no-var-requires const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Meter: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 'T', id: this.device.bleMac, diff --git a/src/devices/motion.ts b/src/devices/motion.ts index a6edfa77..25ab3754 100644 --- a/src/devices/motion.ts +++ b/src/devices/motion.ts @@ -239,8 +239,7 @@ export class Motion { // eslint-disable-next-line @typescript-eslint/no-var-requires const switchbot = this.connectBLE(); // Start to monitor advertisement packets - this.debugLog(`Motion Sensor: ${this.accessory.displayName} platform.Switchbot: ${JSON.stringify(switchbot)}`); - if (switchbot) { + if (switchbot !== false) { switchbot.startScan({ model: 's', id: this.device.bleMac,