Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
remove debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
takeyaqa committed Feb 28, 2021
1 parent 584dc9b commit 38722f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/natureRemoApi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import https from 'https';
import querystring from 'querystring';
import { IncomingMessage } from 'http';
import { Logging } from 'homebridge';

import { Mutex } from './mutex';

Expand Down Expand Up @@ -77,14 +76,12 @@ export class NatureRemoApi {

constructor(
private readonly accessToken: string,
private readonly logger: Logging,
) {}

async getAllAppliances(): Promise<Appliance[]> {
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`;
Expand All @@ -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`;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down

0 comments on commit 38722f7

Please sign in to comment.