@switchbot/homebridge-switchbot 3.7.1-beta.20 → 3.7.1-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/platform.js CHANGED
@@ -10,7 +10,7 @@ import { EveHomeKitTypes } from 'homebridge-lib/EveHomeKitTypes';
10
10
  * For Testing Locally:
11
11
  * import { SwitchBotModel } from '/Users/Shared/GitHub/OpenWonderLabs/node-switchbot/dist/index.js';
12
12
  */
13
- import { SwitchBotModel } from 'node-switchbot';
13
+ import { SwitchBot, SwitchBotModel } from 'node-switchbot';
14
14
  import { queueScheduler } from 'rxjs';
15
15
  import { request } from 'undici';
16
16
  import { BlindTilt } from './device/blindtilt.js';
@@ -308,7 +308,6 @@ export class SwitchBotPlatform {
308
308
  async setupBlE() {
309
309
  if (this.config.options?.BLE) {
310
310
  await this.debugLog('setupBLE');
311
- const SwitchBot = (await import('node-switchbot')).SwitchBot;
312
311
  const switchbot = new SwitchBot();
313
312
  if (switchbot === undefined) {
314
313
  await this.errorLog(`wasn't able to establish BLE Connection, node-switchbot: ${switchbot}`);
@@ -2551,7 +2550,6 @@ export class SwitchBotPlatform {
2551
2550
  // BLE Connection
2552
2551
  async connectBLE(accessory, device) {
2553
2552
  try {
2554
- const { SwitchBot } = await import('node-switchbot');
2555
2553
  const switchbot = new SwitchBot();
2556
2554
  queueScheduler.schedule(async () => switchbot);
2557
2555
  await this.debugLog(`${device.deviceType}: ${accessory.displayName} 'node-switchbot' found: ${switchbot}`);