Skip to content

Commit bcdf27a

Browse files
v3.1.0 (#260)
## [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]>
1 parent 122b974 commit bcdf27a

30 files changed

+799
-907
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: ${{ github.repository == 'OpenWonderLabs/node-switchbot' }}
2828
uses: OpenWonderLabs/.github/.github/workflows/discord-webhooks.yml@latest
2929
with:
30-
title: "Node-SwitchBot Beta Release"
30+
title: "Node-SwitchBot Release"
3131
description: |
3232
Version `v${{ needs.publish.outputs.NPM_VERSION }}`
3333
url: "https://github.com/homebridge/camera-utils/releases/tag/v${{ needs.publish.outputs.NPM_VERSION }}"

BLE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const switchBotBLE = new SwitchBotBLE()
8080
try {
8181
await switchBotBLE.startScan()
8282
} catch (e: any) {
83-
console.error(`Failed to start BLE scanning. Error:${e}`)
83+
console.error(`Failed to start BLE scanning, Error: ${e.message ?? e}`)
8484
}
8585
```
8686

@@ -230,7 +230,7 @@ switchBotBLE.onadvertisement = async (ad: any) => {
230230
try {
231231
this.bleEventHandler[ad.address]?.(ad.serviceData)
232232
} catch (e: any) {
233-
await this.errorLog(`Failed to handle BLE event. Error:${e}`)
233+
await this.errorLog(`Failed to handle BLE event, Error: ${e.message ?? e}`)
234234
}
235235
}
236236
```
@@ -246,7 +246,7 @@ try {
246246
switchBotBLE.stopScan()
247247
console.log('Stopped BLE scanning to close listening.')
248248
} catch (e: any) {
249-
console.error(`Failed to stop BLE scanning, error:${e.message}`)
249+
console.error(`Failed to stop BLE scanning, Error: ${e.message ?? e}`)
250250
}
251251
```
252252

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

733733
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.
734+
Or, use [`switchbot-get-encryption-key`](https://www.npmjs.com/package/switchbot-get-encryption-key) npm script.
734735

735736
| Property | Type | Description |
736737
| :-------------- | :----- | :----------------------------------------------------------------------------------------------- |

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

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

5+
## [3.1.0](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v3.1.0) (2024-10-11)
6+
7+
### What's Changed
8+
- Added support for emitting logs from this module from the `SwitchBotBLE` class.
9+
- Housekeeping and update dependencies
10+
11+
**Full Changelog**: https://github.com/OpenWonderLabs/node-switchbot/compare/v3.0.1...v3.1.0
12+
513
## [3.0.1](https://github.com/OpenWonderLabs/node-switchbot/releases/tag/v3.0.1) (2024-10-05)
614

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

OpenAPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ async function getDevices() {
4747
try {
4848
const devices = await switchBotAPI.getDevices()
4949
console.log('Devices:', devices)
50-
} catch (error) {
51-
console.error('Error getting devices:', error)
50+
} catch (e: any) {
51+
console.error(`failed to get devices, Error: ${e.message ?? e}`)
5252
}
5353
}
5454

docs/media/BLE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const switchBotBLE = new SwitchBotBLE()
8080
try {
8181
await switchBotBLE.startScan()
8282
} catch (e: any) {
83-
console.error(`Failed to start BLE scanning. Error:${e}`)
83+
console.error(`Failed to start BLE scanning, Error: ${e.message ?? e}`)
8484
}
8585
```
8686

@@ -230,7 +230,7 @@ switchBotBLE.onadvertisement = async (ad: any) => {
230230
try {
231231
this.bleEventHandler[ad.address]?.(ad.serviceData)
232232
} catch (e: any) {
233-
await this.errorLog(`Failed to handle BLE event. Error:${e}`)
233+
await this.errorLog(`Failed to handle BLE event, Error: ${e.message ?? e}`)
234234
}
235235
}
236236
```
@@ -246,7 +246,7 @@ try {
246246
switchBotBLE.stopScan()
247247
console.log('Stopped BLE scanning to close listening.')
248248
} catch (e: any) {
249-
console.error(`Failed to stop BLE scanning, error:${e.message}`)
249+
console.error(`Failed to stop BLE scanning, Error: ${e.message ?? e}`)
250250
}
251251
```
252252

0 commit comments

Comments
 (0)