@@ -134,7 +134,7 @@ <h3>Metadata</h3>
134
134
135
135
< tr >
136
136
< td class ="col-md-3 "> template</ td >
137
- < td class ="col-md-9 "> < pre class ="line-numbers "> < code class ="language-html "> <span>{{ value || "000" }}<sup>%</sup></span>
137
+ < td class ="col-md-9 "> < pre class ="line-numbers "> < code class ="language-html "> <span data-testid="value" >{{ value || "000" }}<sup>%</sup></span>
138
138
<mat-progress-spinner
139
139
[color]="color"
140
140
[mode]="mode"
@@ -173,6 +173,10 @@ <h6><b>Properties</b></h6>
173
173
< li >
174
174
< a href ="#color "> color</ a >
175
175
</ li >
176
+ < li >
177
+ < span class ="modifier "> Public</ span >
178
+ < a href ="#console "> console</ a >
179
+ </ li >
176
180
< li >
177
181
< a href ="#deviceSubscription "> deviceSubscription</ a >
178
182
</ li >
@@ -261,7 +265,7 @@ <h3 id="constructor">Constructor</h3>
261
265
< tbody >
262
266
< tr >
263
267
< td class ="col-md-4 ">
264
- < code > constructor(service: < a href ="../injectables/BleService.html "> BleService</ a > , snackBar: MatSnackBar)</ code >
268
+ < code > constructor(service: < a href ="../injectables/BleService.html "> BleService</ a > , snackBar: MatSnackBar, console: < a href =" ../injectables/ConsoleLoggerService.html " > ConsoleLoggerService </ a > )</ code >
265
269
</ td >
266
270
</ tr >
267
271
< tr >
@@ -307,6 +311,18 @@ <h3 id="constructor">Constructor</h3>
307
311
</ td >
308
312
309
313
</ tr >
314
+ < tr >
315
+ < td > console</ td >
316
+
317
+ < td >
318
+ < code > < a href ="../injectables/ConsoleLoggerService.html " target ="_self " > ConsoleLoggerService</ a > </ code >
319
+ </ td >
320
+
321
+ < td >
322
+ No
323
+ </ td >
324
+
325
+ </ tr >
310
326
</ tbody >
311
327
</ table >
312
328
</ div >
@@ -347,8 +363,8 @@ <h3 id="methods">
347
363
348
364
< tr >
349
365
< td class ="col-md-4 ">
350
- < div class ="io-line "> Defined in < a href ="" data-line ="124 "
351
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:124 </ a > </ div >
366
+ < div class ="io-line "> Defined in < a href ="" data-line ="127 "
367
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:127 </ a > </ div >
352
368
</ td >
353
369
</ tr >
354
370
@@ -386,8 +402,8 @@ <h3 id="methods">
386
402
387
403
< tr >
388
404
< td class ="col-md-4 ">
389
- < div class ="io-line "> Defined in < a href ="" data-line ="97 "
390
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:97 </ a > </ div >
405
+ < div class ="io-line "> Defined in < a href ="" data-line ="100 "
406
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:100 </ a > </ div >
391
407
</ td >
392
408
</ tr >
393
409
@@ -425,8 +441,8 @@ <h3 id="methods">
425
441
426
442
< tr >
427
443
< td class ="col-md-4 ">
428
- < div class ="io-line "> Defined in < a href ="" data-line ="130 "
429
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:130 </ a > </ div >
444
+ < div class ="io-line "> Defined in < a href ="" data-line ="133 "
445
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:133 </ a > </ div >
430
446
</ td >
431
447
</ tr >
432
448
@@ -495,8 +511,8 @@ <h3 id="methods">
495
511
496
512
< tr >
497
513
< td class ="col-md-4 ">
498
- < div class ="io-line "> Defined in < a href ="" data-line ="134 "
499
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:134 </ a > </ div >
514
+ < div class ="io-line "> Defined in < a href ="" data-line ="137 "
515
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:137 </ a > </ div >
500
516
</ td >
501
517
</ tr >
502
518
@@ -534,8 +550,8 @@ <h3 id="methods">
534
550
535
551
< tr >
536
552
< td class ="col-md-4 ">
537
- < div class ="io-line "> Defined in < a href ="" data-line ="89 "
538
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:89 </ a > </ div >
553
+ < div class ="io-line "> Defined in < a href ="" data-line ="90 "
554
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:90 </ a > </ div >
539
555
</ td >
540
556
</ tr >
541
557
@@ -573,8 +589,8 @@ <h3 id="methods">
573
589
574
590
< tr >
575
591
< td class ="col-md-4 ">
576
- < div class ="io-line "> Defined in < a href ="" data-line ="113 "
577
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:113 </ a > </ div >
592
+ < div class ="io-line "> Defined in < a href ="" data-line ="116 "
593
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:116 </ a > </ div >
578
594
</ td >
579
595
</ tr >
580
596
@@ -612,8 +628,8 @@ <h3 id="methods">
612
628
613
629
< tr >
614
630
< td class ="col-md-4 ">
615
- < div class ="io-line "> Defined in < a href ="" data-line ="118 "
616
- class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:118 </ a > </ div >
631
+ < div class ="io-line "> Defined in < a href ="" data-line ="121 "
632
+ class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:121 </ a > </ div >
617
633
</ td >
618
634
</ tr >
619
635
@@ -696,6 +712,34 @@ <h3 id="inputs">
696
712
</ tr >
697
713
698
714
715
+ </ tbody >
716
+ </ table >
717
+ < table class ="table table-sm table-bordered ">
718
+ < tbody >
719
+ < tr >
720
+ < td class ="col-md-4 ">
721
+ < a name ="console "> </ a >
722
+ < span class ="name ">
723
+ < b >
724
+ < span class ="modifier "> Public</ span >
725
+ console</ b >
726
+ < a href ="#console "> < span class ="icon ion-ios-link "> </ span > </ a >
727
+ </ span >
728
+ </ td >
729
+ </ tr >
730
+ < tr >
731
+ < td class ="col-md-4 ">
732
+ < i > Type : </ i > < code > < a href ="../injectables/ConsoleLoggerService.html " target ="_self " > ConsoleLoggerService</ a > </ code >
733
+
734
+ </ td >
735
+ </ tr >
736
+ < tr >
737
+ < td class ="col-md-4 ">
738
+ < div class ="io-line "> Defined in < a href ="" data-line ="81 " class ="link-to-prism "> src/app/thingy52/battery-level.component.ts:81</ a > </ div >
739
+ </ td >
740
+ </ tr >
741
+
742
+
699
743
</ tbody >
700
744
</ table >
701
745
< table class ="table table-sm table-bordered ">
@@ -957,7 +1001,7 @@ <h3 id="accessors">
957
1001
@Component({
958
1002
selector: 'ble-battery-level',
959
1003
template: `
960
- <span>{{ value || "000" }}<sup>%</sup></span>
1004
+ <span data-testid="value" >{{ value || "000" }}<sup>%</sup></span>
961
1005
<mat-progress-spinner
962
1006
[color]="color"
963
1007
[mode]="mode"
@@ -1011,7 +1055,8 @@ <h3 id="accessors">
1011
1055
1012
1056
constructor(
1013
1057
public service: BleService,
1014
- public snackBar: MatSnackBar) {
1058
+ public snackBar: MatSnackBar,
1059
+ public console: ConsoleLoggerService) {
1015
1060
1016
1061
service.config({
1017
1062
decoder: (value: DataView) => value.getInt8(0),
@@ -1024,7 +1069,9 @@ <h3 id="accessors">
1024
1069
this.getDeviceStatus();
1025
1070
1026
1071
this.streamSubscription = this.service.stream()
1027
- .subscribe((value: number) => this.updateValue(value), error => this.hasError(error));
1072
+ .subscribe((value: number) => {
1073
+ this.updateValue(value);
1074
+ }, error => this.hasError(error));
1028
1075
1029
1076
}
1030
1077
@@ -1046,11 +1093,11 @@ <h3 id="accessors">
1046
1093
1047
1094
requestValue() {
1048
1095
this.valuesSubscription = this.service.value()
1049
- .subscribe(() => null , error => this.hasError.bind(this ));
1096
+ .subscribe((value: number ) => this.updateValue(value) , error => this.hasError(error ));
1050
1097
}
1051
1098
1052
1099
updateValue(value: number) {
1053
- console.log('Reading battery level %d', value);
1100
+ this. console.log('Reading battery level %d', value);
1054
1101
this.value = value;
1055
1102
this.mode = 'determinate';
1056
1103
}
@@ -1066,13 +1113,12 @@ <h3 id="accessors">
1066
1113
}
1067
1114
1068
1115
ngOnDestroy() {
1069
- this.valuesSubscription.unsubscribe();
1070
- this.deviceSubscription.unsubscribe();
1071
- this.streamSubscription.unsubscribe();
1116
+ this.valuesSubscription? .unsubscribe();
1117
+ this.deviceSubscription? .unsubscribe();
1118
+ this.streamSubscription? .unsubscribe();
1072
1119
}
1073
1120
}
1074
1121
1075
-
1076
1122
</ code > </ pre >
1077
1123
</ div >
1078
1124
@@ -1134,7 +1180,7 @@ <h3 id="accessors">
1134
1180
< script src ="../js/libs/htmlparser.js "> </ script >
1135
1181
< script src ="../js/libs/deep-iterator.js "> </ script >
1136
1182
< script >
1137
- var COMPONENT_TEMPLATE = '<div><span>{{ value || "000" }}<sup>%</sup></span><mat-progress-spinner [color]="color" [mode]="mode" diameter="250" strokeWidth="2" [value]="value || 100"></mat-progress-spinner><mat-icon>battery_charging_full</mat-icon></div>'
1183
+ var COMPONENT_TEMPLATE = '<div><span data-testid="value" >{{ value || "000" }}<sup>%</sup></span><mat-progress-spinner [color]="color" [mode]="mode" diameter="250" strokeWidth="2" [value]="value || 100"></mat-progress-spinner><mat-icon>battery_charging_full</mat-icon></div>'
1138
1184
var COMPONENTS = [ { 'name' : 'AppComponent' , 'selector' : 'ble-root' } , { 'name' : 'BatteryLevelComponent' , 'selector' : 'ble-battery-level' } , { 'name' : 'DashboardComponent' , 'selector' : 'ble-dashboard' } , { 'name' : 'HumidityComponent' , 'selector' : 'ble-humidity' } , { 'name' : 'StepCounterComponent' , 'selector' : 'ble-stepcounter' } , { 'name' : 'TemperatureComponent' , 'selector' : 'ble-temperature' } ] ;
1139
1185
var DIRECTIVES = [ ] ;
1140
1186
var ACTUAL_COMPONENT = { 'name' : 'BatteryLevelComponent' } ;
0 commit comments