Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/devices/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ export abstract class SwitchBotDevice extends EventEmitter {
try {
return await tryBLE()
} catch (err) {
this.logger?.warn?.('BLE getStatus failed, falling back to API', err)
this.logger?.warn?.('BLE getStatus failed', err)
if (this.enableFallback && this.hasAPI()) {
this.logger?.warn?.('Falling back to API getStatus', err)
}
}
if (this.enableFallback && this.hasAPI()) {
return await tryAPI()
Expand All @@ -357,7 +360,10 @@ export abstract class SwitchBotDevice extends EventEmitter {
try {
return await tryAPI()
} catch (err) {
this.logger?.warn?.('API getStatus failed, falling back to BLE', err)
this.logger?.warn?.('API getStatus failed', err)
if (this.enableFallback && this.hasBLE()) {
this.logger?.warn?.('Falling back to BLE getStatus', err)
}
}
if (this.enableFallback && this.hasBLE()) {
return await tryBLE()
Expand Down
Loading