@@ -365,56 +365,61 @@ const pageIcons = connect(
365
365
}
366
366
const config = getConfig ( ) // always re-read in case config has been mutated by config screens, and app page is not refreshed
367
367
const customClimates = Object . values ( config . customClimates ) . map ( ( x ) => x . name )
368
- quickOptions ( customClimates . concat ( STANDARD_CLIMATE_OPTIONS ) , {
369
- title : 'Confirm climate action' ,
370
- onOptionSelect : ( opt ) => {
371
- if ( opt === 'Cancel' ) return
372
- let payload = undefined
373
- if ( ! STANDARD_CLIMATE_OPTIONS . includes ( opt ) ) {
374
- payload = Object . values ( config . customClimates ) . filter ( ( x ) => x . name === opt ) [ 0 ]
375
- }
376
- doAsyncUpdate ( {
377
- command : 'climate' ,
378
- bl : bl ,
379
- payload : payload
380
- ? ( { ...payload , enable : true } as ClimateRequest )
381
- : ( {
382
- enable : opt !== 'Off' ? true : false ,
383
- frontDefrost : opt === 'Warm' ? true : false ,
384
- rearDefrost : opt === 'Warm' ? true : false ,
385
- steering : opt === 'Warm' ? true : false ,
386
- temp : opt === 'Warm' ? config . climateTempWarm : config . climateTempCold ,
387
- durationMinutes : 15 ,
388
- } as ClimateRequest ) ,
389
- actions : updatingActions ,
390
- actionKey : 'climate' ,
391
- updatingText : payload
392
- ? `Starting custom climate ...`
393
- : opt === 'Warm'
394
- ? 'Starting pre-heat ...'
395
- : opt === 'Cool'
396
- ? 'Starting cool ...'
397
- : 'Stopping climate ...' ,
398
- successText : payload
399
- ? `Custom climate Started!`
400
- : opt === 'Warm'
401
- ? 'Climate heating!'
402
- : opt === 'Cool'
403
- ? 'Climate cooling!'
404
- : 'Climate stopped!' ,
405
- failureText : `Failed to ${ opt === 'Off' ? 'Stop' : 'Start' } climate!!!` ,
406
- successCallback : ( data ) => {
407
- updateStatus ( {
408
- ...bl . getCachedStatus ( ) ,
409
- status : {
410
- ...data ,
411
- isClimateOn : opt !== 'Off' ? true : false ,
412
- } ,
413
- } as Status )
414
- } ,
415
- } )
368
+ quickOptions (
369
+ config . hideDefaultClimates && customClimates . length > 0
370
+ ? customClimates
371
+ : customClimates . concat ( STANDARD_CLIMATE_OPTIONS ) ,
372
+ {
373
+ title : 'Confirm climate action' ,
374
+ onOptionSelect : ( opt ) => {
375
+ if ( opt === 'Cancel' ) return
376
+ let payload = undefined
377
+ if ( ! STANDARD_CLIMATE_OPTIONS . includes ( opt ) ) {
378
+ payload = Object . values ( config . customClimates ) . filter ( ( x ) => x . name === opt ) [ 0 ]
379
+ }
380
+ doAsyncUpdate ( {
381
+ command : 'climate' ,
382
+ bl : bl ,
383
+ payload : payload
384
+ ? ( { ...payload , enable : true } as ClimateRequest )
385
+ : ( {
386
+ enable : opt !== 'Off' ? true : false ,
387
+ frontDefrost : opt === 'Warm' ? true : false ,
388
+ rearDefrost : opt === 'Warm' ? true : false ,
389
+ steering : opt === 'Warm' ? true : false ,
390
+ temp : opt === 'Warm' ? config . climateTempWarm : config . climateTempCold ,
391
+ durationMinutes : 15 ,
392
+ } as ClimateRequest ) ,
393
+ actions : updatingActions ,
394
+ actionKey : 'climate' ,
395
+ updatingText : payload
396
+ ? `Starting custom climate ...`
397
+ : opt === 'Warm'
398
+ ? 'Starting pre-heat ...'
399
+ : opt === 'Cool'
400
+ ? 'Starting cool ...'
401
+ : 'Stopping climate ...' ,
402
+ successText : payload
403
+ ? `Custom climate Started!`
404
+ : opt === 'Warm'
405
+ ? 'Climate heating!'
406
+ : opt === 'Cool'
407
+ ? 'Climate cooling!'
408
+ : 'Climate stopped!' ,
409
+ failureText : `Failed to ${ opt === 'Off' ? 'Stop' : 'Start' } climate!!!` ,
410
+ successCallback : ( data ) => {
411
+ updateStatus ( {
412
+ ...bl . getCachedStatus ( ) ,
413
+ status : {
414
+ ...data ,
415
+ isClimateOn : opt !== 'Off' ? true : false ,
416
+ } ,
417
+ } as Status )
418
+ } ,
419
+ } )
420
+ } ,
416
421
} ,
417
- } )
422
+ )
418
423
} ,
419
424
} ,
420
425
) ,
0 commit comments