Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
## [Version 0.1.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v0.1.1) (2020-09-11)

### Changes

- Fix Contact Sensor adding as Motion Sensor instead of Contact Sensor
  • Loading branch information
donavanbecker committed Sep 11, 2021
1 parent ed204df commit d07f44a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ All notable changes to this project will be documented in this file. This projec

- Offical release of homebridge-Switchbot, which combines both BLE and OpenAPI into 1 plugin.

## [Version 0.1.1](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v0.1.1) (2020-09-11)

## [Version 0.1.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.0.0) (2020-09-10)
### Changes

- Fix Contact Sensor adding as Motion Sensor instead of Contact Sensor

## [Version 0.1.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v0.1.0) (2020-09-10)

### Changes

Expand Down
4 changes: 2 additions & 2 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": "0.1.0",
"version": "0.1.1",
"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
37 changes: 15 additions & 22 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Humidifier(this, accessory, device);
Expand Down Expand Up @@ -562,7 +561,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Meter(this, accessory, device);
Expand Down Expand Up @@ -600,8 +598,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
);

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
//existingAccessory.context.firmwareRevision = firmware;
//this.api.updatePlatformAccessories([existingAccessory]);
existingAccessory.context.model = device.deviceType;
existingAccessory.context.deviceID = device.deviceId;
existingAccessory.context.firmwareRevision = this.version;
this.api.updatePlatformAccessories([existingAccessory]);
// create the accessory handler for the restored accessory
// this is imported from `platformAccessory.ts`
new Motion(this, existingAccessory, device);
Expand All @@ -618,9 +618,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {

// store a copy of the device object in the `accessory.context`
// the `context` property can be used to store any data about the accessory you may need
//accessory.context.firmwareRevision = firmware;
accessory.context.device = device;
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
accessory.context.model = device.deviceType;
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Motion(this, accessory, device);
Expand Down Expand Up @@ -658,8 +659,10 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
);

// if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:
//existingAccessory.context.firmwareRevision = firmware;
//this.api.updatePlatformAccessories([existingAccessory]);
existingAccessory.context.model = device.deviceType;
existingAccessory.context.deviceID = device.deviceId;
existingAccessory.context.firmwareRevision = this.version;
this.api.updatePlatformAccessories([existingAccessory]);
// create the accessory handler for the restored accessory
// this is imported from `platformAccessory.ts`
new Contact(this, existingAccessory, device);
Expand All @@ -676,12 +679,13 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {

// store a copy of the device object in the `accessory.context`
// the `context` property can be used to store any data about the accessory you may need
//accessory.context.firmwareRevision = firmware;
accessory.context.device = device;
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
accessory.context.model = device.deviceType;
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Motion(this, accessory, device);
new Contact(this, accessory, device);
this.debug(`${device.deviceType} UDID: ${device.deviceName}-${device.deviceId}-${device.deviceType}`);

// link the accessory to your platform
Expand Down Expand Up @@ -755,7 +759,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Curtain(this, accessory, device);
Expand Down Expand Up @@ -827,7 +830,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Plug(this, accessory, device);
Expand Down Expand Up @@ -890,7 +892,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new TV(this, accessory, device);
Expand Down Expand Up @@ -961,7 +962,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Fan(this, accessory, device);
Expand Down Expand Up @@ -1025,7 +1025,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Light(this, accessory, device);
Expand Down Expand Up @@ -1089,7 +1088,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new AirConditioner(this, accessory, device);
Expand Down Expand Up @@ -1153,7 +1151,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new AirPurifier(this, accessory, device);
Expand Down Expand Up @@ -1217,7 +1214,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new WaterHeater(this, accessory, device);
Expand Down Expand Up @@ -1281,7 +1277,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new VacuumCleaner(this, accessory, device);
Expand Down Expand Up @@ -1345,7 +1340,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Camera(this, accessory, device);
Expand Down Expand Up @@ -1409,7 +1403,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
accessory.context.deviceID = device.deviceId;
accessory.context.firmwareRevision = this.version;
await this.connectionTypeNewAccessory(device, accessory);
// accessory.context.firmwareRevision = findaccessories.accessoryAttribute.softwareRevision;
// create the accessory handler for the newly create accessory
// this is imported from `platformAccessory.ts`
new Others(this, accessory, device);
Expand Down

0 comments on commit d07f44a

Please sign in to comment.