From 38722f73360ca38a3485b0c5604869543ceb3065 Mon Sep 17 00:00:00 2001 From: Takeshi Kishi Date: Sun, 28 Feb 2021 21:54:24 +0900 Subject: [PATCH] remove debug log --- src/natureRemoApi.ts | 6 ------ src/platform.ts | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/natureRemoApi.ts b/src/natureRemoApi.ts index b479807..c84e2f6 100644 --- a/src/natureRemoApi.ts +++ b/src/natureRemoApi.ts @@ -1,7 +1,6 @@ import https from 'https'; import querystring from 'querystring'; import { IncomingMessage } from 'http'; -import { Logging } from 'homebridge'; import { Mutex } from './mutex'; @@ -77,14 +76,12 @@ export class NatureRemoApi { constructor( private readonly accessToken: string, - private readonly logger: Logging, ) {} async getAllAppliances(): Promise { const release = await this.mutex.acquire(); try { if (this.applianceCache.appliances && (Date.now() - this.applianceCache.updated) < CACHE_THRESHOLD) { - this.logger.debug('[NatureRemoApi] Using cached appliances'); return this.applianceCache.appliances; } const url = `${API_URL}/1/appliances`; @@ -100,7 +97,6 @@ export class NatureRemoApi { const release = await this.mutex.acquire(); try { if (this.deviceCache.devices && (Date.now() - this.deviceCache.updated) < CACHE_THRESHOLD) { - this.logger.debug('[NatureRemoApi] Using cached devices'); return this.deviceCache.devices; } const url = `${API_URL}/1/devices`; @@ -179,7 +175,6 @@ export class NatureRemoApi { }, }; https.get(url, options, (res) => { - this.logger.debug('[NatureRemoApi] Recieved API server response'); if (res.statusCode !== 200) { reject(new Error(this.getHttpErrorMessage(res))); } else { @@ -210,7 +205,6 @@ export class NatureRemoApi { }, }; const req = https.request(url, options, (res) => { - this.logger.debug('[NatureRemoApi] Send message request'); if (res.statusCode !== 200) { reject(new Error(this.getHttpErrorMessage(res))); } else { diff --git a/src/platform.ts b/src/platform.ts index 4697a24..a2c9764 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -27,7 +27,7 @@ export class NatureRemoPlatform implements DynamicPlatformPlugin { public readonly api: API, ) { this.logger.debug('accessToken ->', this.config.accessToken); - this.natureRemoApi = new NatureRemoApi(this.config.accessToken as string, logger); + this.natureRemoApi = new NatureRemoApi(this.config.accessToken as string); this.logger.debug('Finished initializing platform:', this.config.name); this.api.on(APIEvent.DID_FINISH_LAUNCHING, () => {