@switchbot/homebridge-switchbot 5.0.0-beta.50 → 5.0.0-beta.51

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.
@@ -180,16 +180,18 @@ export class SwitchBotMatterPlatform implements DynamicPlatformPlugin {
180
180
  }
181
181
 
182
182
  // Initialize API request tracking
183
- try {
184
- this.apiTracker = new ApiRequestTracker(this.api, this.log, 'SwitchBot Matter', {
185
- dailyLimit: this.config.options?.dailyApiLimit ?? 10000,
186
- reserveForCommands: this.config.options?.dailyApiReserveForCommands ?? 1000,
187
- pausePollingAtReserve: this.config.options?.webhookOnlyOnReserve ?? false,
188
- resetAtLocalMidnight: this.config.options?.dailyApiResetAtLocalMidnight ?? false,
189
- })
190
- this.apiTracker.startHourlyLogging()
191
- } catch (e: any) {
192
- this.errorLog('Failed to initialize API request tracking:', e?.message ?? e)
183
+ if (this.switchBotAPI) {
184
+ try {
185
+ this.apiTracker = new ApiRequestTracker(this.api, this.log, 'SwitchBot Matter', {
186
+ dailyLimit: this.config.options?.dailyApiLimit ?? 10000,
187
+ reserveForCommands: this.config.options?.dailyApiReserveForCommands ?? 1000,
188
+ pausePollingAtReserve: this.config.options?.webhookOnlyOnReserve ?? false,
189
+ resetAtLocalMidnight: this.config.options?.dailyApiResetAtLocalMidnight ?? false,
190
+ })
191
+ this.apiTracker.startHourlyLogging()
192
+ } catch (e: any) {
193
+ this.errorLog('Failed to initialize API request tracking:', e?.message ?? e)
194
+ }
193
195
  }
194
196
 
195
197
  try {