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

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,20 @@ 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
+ // Parity with HAP platform: indicate successful initialization of API tracking (Matter-specific wording)
193
+ this.debugLog('API request tracking initialized (Matter platform, OpenAPI)')
194
+ } catch (e: any) {
195
+ this.errorLog('Failed to initialize API request tracking:', e?.message ?? e)
196
+ }
193
197
  }
194
198
 
195
199
  try {