I have a header with transparency configured. It has been working great until I updated to 0.99. Now, my header is opaque instead of showing the page background through it. Did something change with 0.99?
a ok, will check that, its just that I thought you had instructed to leve out the ‘return’. This works fine without it:
- tab:
'alarm':
icon: >
var alarm = entity['alarm_control_panel.ha_main_alarm'].state;
if (alarm == 'disarmed') 'mdi:shield-check';
else if (alarm == 'armed_away') 'mdi:shield-lock';
else if (alarm == 'armed_custom_bypass') 'mdi:security';
else if (alarm == 'armed_home') 'mdi:shield-home';
else if (alarm == 'armed_night') 'mdi:shield-home';
else if (alarm == 'pending') 'mdi:shield-outline';
else if (alarm == 'triggered') 'mdi:bell-alert';
else 'mdi:shield-check';
mayker
(maykar (pronounced "maker" with a southern accent))
1214
Because there is an “if” statement involved there. Without either an “if” or a “return” then there is nothing to evaluate. You could use if (true) entity['sensor.weather_icon'].state and it would be the same as my example above.
I see. noted, and thanks for the explanation. It is somewhat different from the other JS templates I use throughout HA, so must make a note of this
the use of else if is different also (simply use if in other templates for all elif), and always use return in the exit, on all lines… so many variations to keep track of…
mayker
(maykar (pronounced "maker" with a southern accent))
1216
You can do it that way as well. CCH is just evaluating the string as javascript. So all of the following examples would work the same:
if (entity['input_boolean.home'].state == "on") "mdi:home";
else if (entity['input_boolean.home'].state == "off") "mdi:away";
else "mdi:emoticon";
if (entity['input_boolean.home'].state == "on") return "mdi:home";
if (entity['input_boolean.home'].state == "off") return "mdi:away";
return "mdi:emoticon";
just to be 100% sure: I do need the ; after each line in the template do I?
mayker
(maykar (pronounced "maker" with a southern accent))
1218
Sorry, yes you do (for multi line statements). I’ll update my examples. Since the config renders it as one long string the semi-colon let’s it know when each statement ends.
( I’m sure there may be better ways to do it and will update you if things change. )
I have this issue as well and was about to post about it in github but was checking here first. I can confirm it works in chrome but not firefox and I have tested this on multiple machines (home/work/laptop).
Just an FYI / PSA for people using the babelized “legacy” version of CCH that I was maintaining for a while and then @mayker took over.
I just did a system update on my Fire 7 tablet and FireOS updated to verison 5.6.4.0 and wonder of wonders, they updated the system webview to v. 70+ and for me at least, Fully Kiosk now works perfectly with stock CCH (and any other .js that is included in Lovelace as type: module).