Skip to content

Commit

Permalink
Version 1.12.2 (#240)
Browse files Browse the repository at this point in the history
## [Version 1.12.2](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.12.2) (2022-02-02)

## What's Changed

- Fix: Issue where `PositionState` was not being sent back to Home App. Fixes [#123](#123) Thanks [@dnicolson](https://github.com/dnicolson)!

**Full Changelog**: v1.12.1...v1.12.2
  • Loading branch information
donavanbecker authored Feb 2, 2022
1 parent 45cad6d commit 1695cb6
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 125 deletions.
264 changes: 153 additions & 111 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
}
},
"doublePress": {
"title": "Do you want to similate a double press?",
"title": "How many presses do you want to simulate?",
"type": "number",
"placeholder": "2",
"condition": {
Expand Down Expand Up @@ -379,7 +379,7 @@
"type": "number",
"minimum": 1,
"placeholder": 5,
"description": "Indicates the number of seconds between before refreshing Curtain status while updating slide progress.",
"description": "Indicates the number of seconds before refreshing Curtain status while updating slide progress.",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
}
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge SwitchBot",
"name": "@switchbot/homebridge-switchbot",
"version": "1.12.1",
"version": "1.12.2",
"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 <[email protected]> (https://github.com/SwitchBot)",
"license": "ISC",
Expand Down
1 change: 1 addition & 0 deletions src/device/curtain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ export class Curtain {
if (this.PositionState === undefined) {
this.debugLog(`Curtain: ${this.accessory.displayName} PositionState: ${this.PositionState}`);
} else {
this.windowCoveringService.updateCharacteristic(this.platform.Characteristic.PositionState, Number(this.PositionState));
this.debugLog(`Curtain: ${this.accessory.displayName} updateCharacteristic PositionState: ${this.PositionState}`);
}
if (this.TargetPosition === undefined || Number.isNaN(this.TargetPosition)) {
Expand Down
14 changes: 11 additions & 3 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
* It should be used to setup event handlers for characteristics and update respective values.
*/
configureAccessory(accessory: PlatformAccessory) {
this.infoLog(`Loading accessory from cache: ${accessory.displayName}`);
this.debugLog(`Loading accessory from cache: ${accessory.displayName}`);

// add the restored accessory to the accessories cache so we can track if it has already been registered
this.accessories.push(accessory);
Expand Down Expand Up @@ -217,7 +217,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
this.debugLog(JSON.stringify(devicesAPI));

// SwitchBot Devices
this.infoLog(`Total SwitchBot Devices Found: ${devicesAPI.body.deviceList.length}`);
if (devicesAPI.body.deviceList.length !== 0) {
this.infoLog(`Total SwitchBot Devices Found: ${devicesAPI.body.deviceList.length}`);
} else {
this.debugLog(`Total SwitchBot Devices Found: ${devicesAPI.body.deviceList.length}`);
}
const deviceLists = devicesAPI.body.deviceList;
if (!this.config.options?.devices) {
this.debugLog(`SwitchBot Device Config Not Set: ${JSON.stringify(this.config.options?.devices)}`);
Expand Down Expand Up @@ -257,7 +261,11 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
this.errorLog('Neither SwitchBot OpenToken or Device Config are not set.');
}
// IR Devices
this.infoLog(`Total IR Devices Found: ${devicesAPI.body.infraredRemoteList.length}`);
if (devicesAPI.body.infraredRemoteList.length !== 0) {
this.infoLog(`Total IR Devices Found: ${devicesAPI.body.infraredRemoteList.length}`);
} else {
this.debugLog(`Total IR Devices Found: ${devicesAPI.body.infraredRemoteList.length}`);
}
const irDeviceLists = devicesAPI.body.infraredRemoteList;
if (!this.config.options?.irdevices) {
this.debugLog(`IR Device Config Not Set: ${JSON.stringify(this.config.options?.irdevices)}`);
Expand Down

0 comments on commit 1695cb6

Please sign in to comment.