@@ -73,7 +73,9 @@ export class RokuCard extends LitElement {
73
73
? this . _renderButton ( 'power' , 'mdi:power' , 'Power' )
74
74
: '' }
75
75
</ div >
76
- ${ this . _config . back ?. show || this . _config . info ?. show || this . _config . home ?. show
76
+ ${ ( this . _config . back && this . _config . back . show !== false ) ||
77
+ ( this . _config . info && this . _config . info . show !== false ) ||
78
+ ( this . _config . home && this . _config . home . show !== false )
77
79
? html `
78
80
< div class ="row ">
79
81
${ this . _renderButton ( 'back' , 'mdi:arrow-left' , 'Back' ) }
@@ -82,14 +84,16 @@ export class RokuCard extends LitElement {
82
84
</ div >
83
85
`
84
86
: '' }
85
- ${ ( this . _config . apps && this . _config . apps . length > 0 ) || this . _config . up ?. show
87
+ ${ ( this . _config . apps && this . _config . apps . length > 0 ) || ( this . _config . up && this . _config . up . show !== false )
86
88
? html `
87
89
< div class ="row ">
88
90
${ this . _renderImage ( 0 ) } ${ this . _renderButton ( 'up' , 'mdi:chevron-up' , 'Up' ) } ${ this . _renderImage ( 1 ) }
89
91
</ div >
90
92
`
91
93
: '' }
92
- ${ this . _config . left ?. show || this . _config . select ?. show || this . _config . right ?. show
94
+ ${ ( this . _config . left && this . _config . left . show !== false ) ||
95
+ ( this . _config . select && this . _config . select . show !== false ) ||
96
+ ( this . _config . right && this . _config . right ?. show !== false )
93
97
? html `
94
98
< div class ="row ">
95
99
${ this . _renderButton ( 'left' , 'mdi:chevron-left' , 'Left' ) }
@@ -98,15 +102,18 @@ export class RokuCard extends LitElement {
98
102
</ div >
99
103
`
100
104
: '' }
101
- ${ ( this . _config . apps && this . _config . apps . length > 2 ) || this . _config . down ?. show
105
+ ${ ( this . _config . apps && this . _config . apps . length > 2 ) ||
106
+ ( this . _config . down && this . _config . down . show !== false )
102
107
? html `
103
108
< div class ="row ">
104
109
${ this . _renderImage ( 2 ) } ${ this . _renderButton ( 'down' , 'mdi:chevron-down' , 'Down' ) }
105
110
${ this . _renderImage ( 3 ) }
106
111
</ div >
107
112
`
108
113
: '' }
109
- ${ this . _config . reverse ?. show || this . _config . play ?. show || this . _config . forward ?. show
114
+ ${ ( this . _config . reverse && this . _config . reverse . show !== false ) ||
115
+ ( this . _config . play && this . _config . play . show !== false ) ||
116
+ ( this . _config . forward && this . _config . forward ?. show !== false )
110
117
? html `
111
118
< div class ="row ">
112
119
${ this . _renderButton ( 'reverse' , 'mdi:rewind' , 'Rewind' ) }
@@ -116,9 +123,9 @@ export class RokuCard extends LitElement {
116
123
`
117
124
: '' }
118
125
${ this . _config . tv ||
119
- this . _config . volume_mute ?. show ||
120
- this . _config . volume_down ?. show ||
121
- this . _config . volume_up ?. show
126
+ ( this . _config . volume_mute && this . _config . volume_mute . show !== false ) ||
127
+ ( this . _config . volume_down && this . _config . volume_down . show !== false ) ||
128
+ ( this . _config . volume_up && this . _config . volume_up . show !== false )
122
129
? html `
123
130
< div class ="row ">
124
131
${ this . _renderButton ( 'volume_mute' , 'mdi:volume-mute' , 'Volume Mute' ) }
@@ -225,21 +232,21 @@ export class RokuCard extends LitElement {
225
232
private _renderButton ( button : string , icon : string , title : string ) : TemplateResult {
226
233
if ( this . _config ) {
227
234
const config = this . _config [ button ] ;
228
- return config && config . show === true
235
+ return config && config . show === false
229
236
? html `
237
+ < ha-icon-button > </ ha-icon-button >
238
+ `
239
+ : html `
230
240
< ha-icon-button
231
241
.button =${ button }
232
- icon =${ config . icon ? config . icon : icon }
233
- title=${ config . title ? config . title : title }
242
+ icon =${ config && config . icon ? config . icon : icon }
243
+ title=${ config && config . title ? config . title : title }
234
244
@action=${ this . _handleAction }
235
245
.actionHandler=${ actionHandler ( {
236
246
hasHold : config && hasAction ( config . hold_action ) ,
237
247
hasDoubleClick : config && hasAction ( config . double_tap_action ) ,
238
248
} ) }
239
249
> </ ha-icon-button >
240
- `
241
- : html `
242
- < ha-icon-button > </ ha-icon-button >
243
250
` ;
244
251
} else {
245
252
return html `` ;
0 commit comments