@@ -45,20 +45,20 @@ const askForRegionInput = () => {
4545 type : 'list' ,
4646 name : 'region' ,
4747 message : 'What Region are you in?' ,
48- choices : [ 'CN' , 'US' , 'EU' , 'CA' ] ,
48+ choices : [ 'CN' , 'US' , 'EU' , 'CA' , 'AU '] ,
4949 } ,
5050 {
5151 type : 'list' ,
5252 name : 'brand' ,
5353 message : 'Which brand are you using?' ,
5454 choices : [ 'hyundai' , 'kia' ] ,
55- }
55+ } ,
5656 ] )
5757 . then ( answers => {
5858 if ( answers . command == 'exit' ) {
5959 return ;
6060 } else {
61- console . log ( answers )
61+ console . log ( answers ) ;
6262 console . log ( 'Logging in...' ) ;
6363 createInstance ( answers . region , answers . brand ) ;
6464 }
@@ -72,7 +72,7 @@ const createInstance = (region, brand) => {
7272 password,
7373 region,
7474 brand,
75- pin
75+ pin,
7676 } ) ;
7777 client . on ( 'ready' , onReadyHandler ) ;
7878} ;
@@ -187,31 +187,30 @@ async function performCommand(command) {
187187 case 'drvInfo' :
188188 const info = await vehicle . driveHistory ( ) ;
189189 console . log ( 'drvInfo : ' ) ;
190- console . dir ( info , { depth : null } ) ;
190+ console . dir ( info , { depth : null } ) ;
191191 break ;
192192 case 'tripInfo' :
193193 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+ ] ) ;
215214 const trips = await vehicle . tripInfo ( { year, month, day : day === 0 ? undefined : day } ) ;
216215 console . log ( 'trips : ' + JSON . stringify ( trips , null , 2 ) ) ;
217216 break ;
@@ -226,21 +225,20 @@ async function performCommand(command) {
226225 await vehicle . stopCharge ( ) ;
227226 break ;
228227 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+ ] ) ;
244242 await vehicle . setChargeTargets ( { fast, slow } ) ;
245243 console . log ( 'targets : OK' ) ;
246244 break ;
0 commit comments