Skip to content

Commit

Permalink
refactor: JSON.stringify readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Loodyy committed Dec 3, 2024
1 parent 88da2cd commit b07c416
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2616,21 +2616,23 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
this.debugLog(`Retry attempt ${retryCount} of ${maxRetries}`)
await sleep(delayBetweenRetries)
}
return { response: {
deviceId: '',
deviceType: '',
hubDeviceId: '',
version: 0,
deviceName: '',
enableCloudService: false,
}, statusCode: 500 }
return {
response: {
deviceId: '',
deviceType: '',
hubDeviceId: '',
version: 0,
deviceName: '',
enableCloudService: false,
}, statusCode: 500
}
}

// BLE Connection
async connectBLE(accessory: PlatformAccessory, device: device & devicesConfig): Promise<any> {
try {
queueScheduler.schedule(async () => this.switchBotBLE)
this.debugLog(`${device.deviceType}: ${accessory.displayName} 'node-switchbot' found: ${JSON.stringify(this.switchBotBLE)}`)
this.debugLog(`${device.deviceType}: ${accessory.displayName} 'node-switchbot' found: ${JSON.stringify(this.switchBotBLE, null, ' ')}`)
return this.switchBotBLE
} catch (e: any) {
this.errorLog(`${device.deviceType}: ${accessory.displayName} 'node-switchbot' not found, Error: ${e.message ?? e}`)
Expand Down

0 comments on commit b07c416

Please sign in to comment.