Skip to content

Commit

Permalink
v3.1.0 (#260)
Browse files Browse the repository at this point in the history
## [3.1.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v3.1.0) (2024-10-11)

### What's Changed
- Added support for emitting logs from this module from the `SwitchBotBLE` class.
- Housekeeping and update dependencies

**Full Changelog**: v3.0.1...v3.1.0

---------

Co-authored-by: shizuka-na-kazushi <[email protected]>
  • Loading branch information
donavanbecker and shizuka-na-kazushi authored Oct 12, 2024
1 parent 122b974 commit bcdf27a
Show file tree
Hide file tree
Showing 30 changed files with 799 additions and 907 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
if: ${{ github.repository == 'OpenWonderLabs/node-switchbot' }}
uses: OpenWonderLabs/.github/.github/workflows/discord-webhooks.yml@latest
with:
title: "Node-SwitchBot Beta Release"
title: "Node-SwitchBot Release"
description: |
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
url: "https://github.com/homebridge/camera-utils/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"
Expand Down
7 changes: 4 additions & 3 deletions BLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const switchBotBLE = new SwitchBotBLE()
try {
await switchBotBLE.startScan()
} catch (e: any) {
console.error(`Failed to start BLE scanning. Error:${e}`)
console.error(`Failed to start BLE scanning, Error: ${e.message ?? e}`)
}
```

Expand Down Expand Up @@ -230,7 +230,7 @@ switchBotBLE.onadvertisement = async (ad: any) => {
try {
this.bleEventHandler[ad.address]?.(ad.serviceData)
} catch (e: any) {
await this.errorLog(`Failed to handle BLE event. Error:${e}`)
await this.errorLog(`Failed to handle BLE event, Error: ${e.message ?? e}`)
}
}
```
Expand All @@ -246,7 +246,7 @@ try {
switchBotBLE.stopScan()
console.log('Stopped BLE scanning to close listening.')
} catch (e: any) {
console.error(`Failed to stop BLE scanning, error:${e.message}`)
console.error(`Failed to stop BLE scanning, Error: ${e.message ?? e}`)
}
```

Expand Down Expand Up @@ -731,6 +731,7 @@ Actually, the `WoSmartLock ` is an object inherited from the [`SwitchbotDevice`]
The `setKey()` method initialises the key information required for encrypted communication with the SmartLock

This must be set before any control commands are sent to the device. To obtain the key information you will need to use an external tool - see [`pySwitchbot`](https://github.com/Danielhiversen/pySwitchbot/tree/master?tab=readme-ov-file#obtaining-locks-encryption-key) project for an example script.
Or, use [`switchbot-get-encryption-key`](https://www.npmjs.com/package/switchbot-get-encryption-key) npm script.

| Property | Type | Description |
| :-------------- | :----- | :----------------------------------------------------------------------------------------------- |
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)

## [3.1.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v3.1.0) (2024-10-11)

### What's Changed
- Added support for emitting logs from this module from the `SwitchBotBLE` class.
- Housekeeping and update dependencies

**Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v3.0.1...v3.1.0

## [3.0.1](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v3.0.1) (2024-10-05)

### What's Changed
Expand All @@ -16,6 +24,7 @@ All notable changes to this project will be documented in this file. This projec
#### ⚠️ Breaking Changes
- Have added OpenAPI Functionality into `node-switchbot`, so now it is able to handle both APIs with just one module.
- There are now two different Classes `SwitchBotBLE` and `SwitchBotOpenAPI` that can be used interact with the two different APIs
- `SwitchBotOpenApi` support emitting logs from this module.
- You will need to update your current setup from`SwitchBot` to `SwitchBotBLE` to be able to interact with the BLE API
- Updated the documents to explain both the `BLE` and the `OpenAPI` Functionality within `node-switchbot`

Expand Down
4 changes: 2 additions & 2 deletions OpenAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ async function getDevices() {
try {
const devices = await switchBotAPI.getDevices()
console.log('Devices:', devices)
} catch (error) {
console.error('Error getting devices:', error)
} catch (e: any) {
console.error(`failed to get devices, Error: ${e.message ?? e}`)
}
}

Expand Down
6 changes: 3 additions & 3 deletions docs/media/BLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const switchBotBLE = new SwitchBotBLE()
try {
await switchBotBLE.startScan()
} catch (e: any) {
console.error(`Failed to start BLE scanning. Error:${e}`)
console.error(`Failed to start BLE scanning, Error: ${e.message ?? e}`)
}
```

Expand Down Expand Up @@ -230,7 +230,7 @@ switchBotBLE.onadvertisement = async (ad: any) => {
try {
this.bleEventHandler[ad.address]?.(ad.serviceData)
} catch (e: any) {
await this.errorLog(`Failed to handle BLE event. Error:${e}`)
await this.errorLog(`Failed to handle BLE event, Error: ${e.message ?? e}`)
}
}
```
Expand All @@ -246,7 +246,7 @@ try {
switchBotBLE.stopScan()
console.log('Stopped BLE scanning to close listening.')
} catch (e: any) {
console.error(`Failed to stop BLE scanning, error:${e.message}`)
console.error(`Failed to stop BLE scanning, Error: ${e.message ?? e}`)
}
```

Expand Down
Loading

0 comments on commit bcdf27a

Please sign in to comment.