@@ -220,15 +220,15 @@ export default class RoombaAccessory implements AccessoryPlugin {
220
220
}
221
221
222
222
public identify ( ) {
223
- this . log ( "Identify requested" ) ;
223
+ this . log . info ( "Identify requested" ) ;
224
224
this . connect ( async ( error , roomba ) => {
225
225
if ( error || ! roomba ) {
226
226
return ;
227
227
}
228
228
try {
229
229
await roomba . find ( ) ;
230
230
} catch ( error ) {
231
- this . log ( "Roomba failed to locate: %s" , ( error as Error ) . message ) ;
231
+ this . log . warn ( "Roomba failed to locate: %s" , ( error as Error ) . message ) ;
232
232
}
233
233
} ) ;
234
234
}
@@ -269,7 +269,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
269
269
270
270
this . connect ( async ( error , roomba ) => {
271
271
if ( error || ! roomba ) {
272
- this . log ( "Failed to connect to Roomba to refresh state: %s" , error ? error . message : "Unknown" ) ;
272
+ this . log . warn ( "Failed to connect to Roomba to refresh state: %s" , error ? error . message : "Unknown" ) ;
273
273
return ;
274
274
}
275
275
@@ -430,7 +430,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
430
430
431
431
private setRunningState ( powerOn : CharacteristicValue , callback : CharacteristicSetCallback ) {
432
432
if ( powerOn ) {
433
- this . log ( "Starting Roomba" ) ;
433
+ this . log . info ( "Starting Roomba" ) ;
434
434
435
435
this . connect ( async ( error , roomba ) => {
436
436
if ( error || ! roomba ) {
@@ -445,7 +445,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
445
445
await roomba . clean ( ) ;
446
446
await roomba . resume ( ) ;
447
447
448
- this . log ( "Roomba is running" ) ;
448
+ this . log . debug ( "Roomba is running" ) ;
449
449
450
450
callback ( ) ;
451
451
@@ -455,13 +455,13 @@ export default class RoombaAccessory implements AccessoryPlugin {
455
455
/* After sending an action to Roomba, we start watching to ensure HomeKit has up to date status */
456
456
this . startWatching ( ) ;
457
457
} catch ( error ) {
458
- this . log ( "Roomba failed: %s" , ( error as Error ) . message ) ;
458
+ this . log . warn ( "Roomba failed: %s" , ( error as Error ) . message ) ;
459
459
460
460
callback ( error as Error ) ;
461
461
}
462
462
} ) ;
463
463
} else {
464
- this . log ( "Stopping Roomba" ) ;
464
+ this . log . info ( "Stopping Roomba" ) ;
465
465
466
466
this . connect ( async ( error , roomba ) => {
467
467
if ( error || ! roomba ) {
@@ -474,7 +474,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
474
474
const state = this . parseState ( response ) ;
475
475
476
476
if ( state . running ) {
477
- this . log ( "Roomba is pausing" ) ;
477
+ this . log . debug ( "Roomba is pausing" ) ;
478
478
479
479
await roomba . pause ( ) ;
480
480
@@ -484,32 +484,32 @@ export default class RoombaAccessory implements AccessoryPlugin {
484
484
this . refreshState ( ) ;
485
485
486
486
if ( this . stopBehaviour === "home" ) {
487
- this . log ( "Roomba paused, returning to Dock" ) ;
487
+ this . log . debug ( "Roomba paused, returning to Dock" ) ;
488
488
await this . dockWhenStopped ( roomba , 3000 ) ;
489
489
} else {
490
- this . log ( "Roomba is paused" ) ;
490
+ this . log . debug ( "Roomba is paused" ) ;
491
491
}
492
492
} else if ( state . docking ) {
493
- this . log ( "Roomba is docking" ) ;
493
+ this . log . debug ( "Roomba is docking" ) ;
494
494
await roomba . pause ( ) ;
495
495
496
496
callback ( ) ;
497
497
498
498
/* Force a refresh of state so we pick up the new state quickly */
499
499
this . refreshState ( ) ;
500
500
501
- this . log ( "Roomba paused" ) ;
501
+ this . log . debug ( "Roomba paused" ) ;
502
502
} else if ( state . charging ) {
503
- this . log ( "Roomba is already docked" ) ;
503
+ this . log . debug ( "Roomba is already docked" ) ;
504
504
callback ( ) ;
505
505
} else {
506
- this . log ( "Roomba is not running" ) ;
506
+ this . log . debug ( "Roomba is not running" ) ;
507
507
callback ( ) ;
508
508
}
509
509
510
510
this . startWatching ( ) ;
511
511
} catch ( error ) {
512
- this . log ( "Roomba failed: %s" , ( error as Error ) . message ) ;
512
+ this . log . warn ( "Roomba failed: %s" , ( error as Error ) . message ) ;
513
513
514
514
callback ( error as Error ) ;
515
515
}
@@ -518,7 +518,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
518
518
}
519
519
520
520
private setDockingState ( docking : CharacteristicValue , callback : CharacteristicSetCallback ) {
521
- this . log ( "Setting docking state to %s" , JSON . stringify ( docking ) ) ;
521
+ this . log . debug ( "Setting docking state to %s" , JSON . stringify ( docking ) ) ;
522
522
523
523
this . connect ( async ( error , roomba ) => {
524
524
if ( error || ! roomba ) {
@@ -529,10 +529,10 @@ export default class RoombaAccessory implements AccessoryPlugin {
529
529
try {
530
530
if ( docking ) {
531
531
await roomba . dock ( ) ;
532
- this . log ( "Roomba is docking" ) ;
532
+ this . log . debug ( "Roomba is docking" ) ;
533
533
} else {
534
534
await roomba . pause ( ) ;
535
- this . log ( "Roomba is paused" ) ;
535
+ this . log . debug ( "Roomba is paused" ) ;
536
536
}
537
537
538
538
callback ( ) ;
@@ -543,7 +543,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
543
543
/* After sending an action to Roomba, we start watching to ensure HomeKit has up to date status */
544
544
this . startWatching ( ) ;
545
545
} catch ( error ) {
546
- this . log ( "Roomba failed: %s" , ( error as Error ) . message ) ;
546
+ this . log . warn ( "Roomba failed: %s" , ( error as Error ) . message ) ;
547
547
548
548
callback ( error as Error ) ;
549
549
}
@@ -556,18 +556,18 @@ export default class RoombaAccessory implements AccessoryPlugin {
556
556
557
557
switch ( state . cleanMissionStatus ! . phase ) {
558
558
case "stop" :
559
- this . log ( "Roomba has stopped, issuing dock request" ) ;
559
+ this . log . debug ( "Roomba has stopped, issuing dock request" ) ;
560
560
561
561
await roomba . dock ( ) ;
562
562
563
- this . log ( "Roomba docking" ) ;
563
+ this . log . debug ( "Roomba docking" ) ;
564
564
565
565
/* Force a refresh of state so we pick up the new state quickly */
566
566
this . refreshState ( ) ;
567
567
568
568
break ;
569
569
case "run" :
570
- this . log ( "Roomba is still running. Will check again in %is" , pollingInterval / 1000 ) ;
570
+ this . log . debug ( "Roomba is still running. Will check again in %is" , pollingInterval / 1000 ) ;
571
571
572
572
await delay ( pollingInterval ) ;
573
573
@@ -576,7 +576,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
576
576
577
577
break ;
578
578
default :
579
- this . log ( "Roomba is not running" ) ;
579
+ this . log . debug ( "Roomba is not running" ) ;
580
580
581
581
break ;
582
582
}
@@ -593,10 +593,10 @@ export default class RoombaAccessory implements AccessoryPlugin {
593
593
const returnCachedStatus = ( status : Status ) => {
594
594
const value = extractValue ( status ) ;
595
595
if ( value === undefined ) {
596
- this . log ( "%s: Returning no value (%ims old)" , name , Date . now ( ) - status . timestamp ! ) ;
596
+ this . log . debug ( "%s: Returning no value (%ims old)" , name , Date . now ( ) - status . timestamp ! ) ;
597
597
callback ( NO_VALUE ) ;
598
598
} else {
599
- this . log ( "%s: Returning %s (%ims old)" , name , String ( value ) , Date . now ( ) - status . timestamp ! ) ;
599
+ this . log . debug ( "%s: Returning %s (%ims old)" , name , String ( value ) , Date . now ( ) - status . timestamp ! ) ;
600
600
callback ( null , value ) ;
601
601
}
602
602
} ;
@@ -612,7 +612,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
612
612
if ( Date . now ( ) - this . cachedStatus . timestamp < MAX_CACHED_STATUS_AGE_MILLIS ) {
613
613
returnCachedStatus ( this . cachedStatus ) ;
614
614
} else {
615
- this . log ( "%s: Returning no value due to timeout" , name ) ;
615
+ this . log . debug ( "%s: Returning no value due to timeout" , name ) ;
616
616
callback ( NO_VALUE ) ;
617
617
}
618
618
} , 500 ) ;
@@ -688,7 +688,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
688
688
689
689
break ;
690
690
default :
691
- this . log . info ( "Unsupported phase: %s" , state . cleanMissionStatus ! . phase ) ;
691
+ this . log . warn ( "Unsupported phase: %s" , state . cleanMissionStatus ! . phase ) ;
692
692
693
693
status . running = false ;
694
694
status . charging = false ;
@@ -792,7 +792,7 @@ export default class RoombaAccessory implements AccessoryPlugin {
792
792
793
793
private startLongWatch ( ) {
794
794
const checkStatus = ( ) => {
795
- this . log . info ( "Refreshing Roomba's status (repeating in %im)" , LONG_WATCH_INTERVAL_MILLIS / 60_000 ) ;
795
+ this . log . debug ( "Refreshing Roomba's status (repeating in %im)" , LONG_WATCH_INTERVAL_MILLIS / 60_000 ) ;
796
796
797
797
this . refreshState ( ) ;
798
798
0 commit comments