11import https from 'https' ;
22import querystring from 'querystring' ;
33import { IncomingMessage } from 'http' ;
4- import { Logging } from 'homebridge' ;
54
65import { Mutex } from './mutex' ;
76
@@ -77,14 +76,12 @@ export class NatureRemoApi {
7776
7877 constructor (
7978 private readonly accessToken : string ,
80- private readonly logger : Logging ,
8179 ) { }
8280
8381 async getAllAppliances ( ) : Promise < Appliance [ ] > {
8482 const release = await this . mutex . acquire ( ) ;
8583 try {
8684 if ( this . applianceCache . appliances && ( Date . now ( ) - this . applianceCache . updated ) < CACHE_THRESHOLD ) {
87- this . logger . debug ( '[NatureRemoApi] Using cached appliances' ) ;
8885 return this . applianceCache . appliances ;
8986 }
9087 const url = `${ API_URL } /1/appliances` ;
@@ -100,7 +97,6 @@ export class NatureRemoApi {
10097 const release = await this . mutex . acquire ( ) ;
10198 try {
10299 if ( this . deviceCache . devices && ( Date . now ( ) - this . deviceCache . updated ) < CACHE_THRESHOLD ) {
103- this . logger . debug ( '[NatureRemoApi] Using cached devices' ) ;
104100 return this . deviceCache . devices ;
105101 }
106102 const url = `${ API_URL } /1/devices` ;
@@ -179,7 +175,6 @@ export class NatureRemoApi {
179175 } ,
180176 } ;
181177 https . get ( url , options , ( res ) => {
182- this . logger . debug ( '[NatureRemoApi] Recieved API server response' ) ;
183178 if ( res . statusCode !== 200 ) {
184179 reject ( new Error ( this . getHttpErrorMessage ( res ) ) ) ;
185180 } else {
@@ -210,7 +205,6 @@ export class NatureRemoApi {
210205 } ,
211206 } ;
212207 const req = https . request ( url , options , ( res ) => {
213- this . logger . debug ( '[NatureRemoApi] Send message request' ) ;
214208 if ( res . statusCode !== 200 ) {
215209 reject ( new Error ( this . getHttpErrorMessage ( res ) ) ) ;
216210 } else {
0 commit comments