@@ -45,20 +45,20 @@ const askForRegionInput = () => {
45
45
type : 'list' ,
46
46
name : 'region' ,
47
47
message : 'What Region are you in?' ,
48
- choices : [ 'CN' , 'US' , 'EU' , 'CA' ] ,
48
+ choices : [ 'CN' , 'US' , 'EU' , 'CA' , 'AU '] ,
49
49
} ,
50
50
{
51
51
type : 'list' ,
52
52
name : 'brand' ,
53
53
message : 'Which brand are you using?' ,
54
54
choices : [ 'hyundai' , 'kia' ] ,
55
- }
55
+ } ,
56
56
] )
57
57
. then ( answers => {
58
58
if ( answers . command == 'exit' ) {
59
59
return ;
60
60
} else {
61
- console . log ( answers )
61
+ console . log ( answers ) ;
62
62
console . log ( 'Logging in...' ) ;
63
63
createInstance ( answers . region , answers . brand ) ;
64
64
}
@@ -72,7 +72,7 @@ const createInstance = (region, brand) => {
72
72
password,
73
73
region,
74
74
brand,
75
- pin
75
+ pin,
76
76
} ) ;
77
77
client . on ( 'ready' , onReadyHandler ) ;
78
78
} ;
@@ -187,31 +187,30 @@ async function performCommand(command) {
187
187
case 'drvInfo' :
188
188
const info = await vehicle . driveHistory ( ) ;
189
189
console . log ( 'drvInfo : ' ) ;
190
- console . dir ( info , { depth : null } ) ;
190
+ console . dir ( info , { depth : null } ) ;
191
191
break ;
192
192
case 'tripInfo' :
193
193
const currentYear = new Date ( ) . getFullYear ( ) ;
194
- const { year, month, day } = await inquirer
195
- . prompt ( [
196
- {
197
- type : 'list' ,
198
- name : 'year' ,
199
- message : 'Which year?' ,
200
- choices : new Array ( currentYear - 2015 ) . fill ( 0 ) . map ( ( _ , i ) => currentYear - i ) ,
201
- } ,
202
- {
203
- type : 'list' ,
204
- name : 'month' ,
205
- message : 'Which month?' ,
206
- choices : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ] ,
207
- } ,
208
- {
209
- type : 'list' ,
210
- name : 'day' ,
211
- message : 'Which day (0 to ignore the day)?' ,
212
- choices : new Array ( 32 ) . fill ( 0 ) . map ( ( _ , i ) => i ) ,
213
- }
214
- ] ) ;
194
+ const { year, month, day } = await inquirer . prompt ( [
195
+ {
196
+ type : 'list' ,
197
+ name : 'year' ,
198
+ message : 'Which year?' ,
199
+ choices : new Array ( currentYear - 2015 ) . fill ( 0 ) . map ( ( _ , i ) => currentYear - i ) ,
200
+ } ,
201
+ {
202
+ type : 'list' ,
203
+ name : 'month' ,
204
+ message : 'Which month?' ,
205
+ choices : [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 ] ,
206
+ } ,
207
+ {
208
+ type : 'list' ,
209
+ name : 'day' ,
210
+ message : 'Which day (0 to ignore the day)?' ,
211
+ choices : new Array ( 32 ) . fill ( 0 ) . map ( ( _ , i ) => i ) ,
212
+ } ,
213
+ ] ) ;
215
214
const trips = await vehicle . tripInfo ( { year, month, day : day === 0 ? undefined : day } ) ;
216
215
console . log ( 'trips : ' + JSON . stringify ( trips , null , 2 ) ) ;
217
216
break ;
@@ -226,21 +225,20 @@ async function performCommand(command) {
226
225
await vehicle . stopCharge ( ) ;
227
226
break ;
228
227
case 'setChargeTargets' :
229
- const { fast, slow } = await inquirer
230
- . prompt ( [
231
- {
232
- type : 'list' ,
233
- name : 'fast' ,
234
- message : 'What fast charge limit do you which to set?' ,
235
- choices : [ 50 , 60 , 70 , 80 , 90 , 100 ] ,
236
- } ,
237
- {
238
- type : 'list' ,
239
- name : 'slow' ,
240
- message : 'What slow charge limit do you which to set?' ,
241
- choices : [ 50 , 60 , 70 , 80 , 90 , 100 ] ,
242
- }
243
- ] ) ;
228
+ const { fast, slow } = await inquirer . prompt ( [
229
+ {
230
+ type : 'list' ,
231
+ name : 'fast' ,
232
+ message : 'What fast charge limit do you which to set?' ,
233
+ choices : [ 50 , 60 , 70 , 80 , 90 , 100 ] ,
234
+ } ,
235
+ {
236
+ type : 'list' ,
237
+ name : 'slow' ,
238
+ message : 'What slow charge limit do you which to set?' ,
239
+ choices : [ 50 , 60 , 70 , 80 , 90 , 100 ] ,
240
+ } ,
241
+ ] ) ;
244
242
await vehicle . setChargeTargets ( { fast, slow } ) ;
245
243
console . log ( 'targets : OK' ) ;
246
244
break ;
0 commit comments