Compact Custom Header

And a quick, hopefully simple question…
What can I use here in the else to revert the colour back to the ‘normal’ one?

e.g.

'var(--SOMETHING-HERE)'

          - color: >  # MDI icon for tab or button.
              if (entity["device_tracker.galaxys8"].state == "home") "blue";
              else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";

@Mariusthvdb you’re absolutely right, you shouldn’t need the hyphen when you only have one item. It should be considered a bug and I’m on it.

@klogg Give this a shot.

          - color: >  # MDI icon for tab or button.
              if (entity["device_tracker.galaxys8"].state == "home") "blue";
              else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
              else "var(--SOMETHING-HERE)";

Sorry, my fault, I wasn’t clear…

I want to know what the SOMETHING-HERE is to point to the default color of the tab icons :slight_smile:

Sorry, try this:

          - color: >  # MDI icon for tab or button.
              if (entity["device_tracker.galaxys8"].state == "home") "blue";
              else if (entity["device_tracker.galaxys8"].state == "not_home") "#ffffff";
              else null;

Let me know if that works for you, I may need to make a change if it doesn’t

wouldn’t that be 'var(--paper-item-icon-color)'

cool. You do breath in between releases do you…? relax…

1 Like

I love @mayker ‘s work but @RomRider is just KILLING it in the new features stakes! I hope neither of them burn out and take some time to enjoy the roses.

OH, IT’S ON like donkey kong! You’re going down @RomRider! :smile:

Once I work out the kinks of the current features I’m going to slow down considerably.

I hadn’t noticed that someone took up button-card, need to check out the new features. I stopped using it a while back when development on it slowed and entity-buttons were introduced.

2 Likes

You will be astonished at what he’s done with it!

@mat44150 @_BaQs
Finally uploaded my final theme! Summer breeze

3 Likes

I second this. RomRider’s progress on custom button card has been nothing short of inspiring. It’s as if he’s unlocked potential in Lovelace that no one thought of let alone knew was possible.

For sure, CCH and custom button-card have been the two biggest drivers for me to get serious about building out my Lovelace setup. Thanks to @mayker and @RomRider for the continued great work!

4 Likes

I second this, both the best cards available!

3 Likes

Is anyone else finding that swipe_prevent_default: true has no effect in Safari on iOS when swiping from the edges? This is on -

  • CCH 1.0.3b7
  • iOS 12.2
  • iPhone 7
  • HA 0.92.0

Yep, I’ve cleared my cache.

          - type: custom:compact-custom-header #Compact Custom Header
            main_config: true
            header: true
            options: show
            chevrons: true
            menu: show
            active_tab_color: rgb(181, 142, 49)
            tab_indicator_color: rgb(181, 142, 49)
            exceptions:
              - conditions:
                  user_agent: Macintosh
                config:
                  hide_tabs: 8 to 17
                  voice: false
              - conditions:
                  user_agent: iPad
                config:
                  show_tabs: 0 to 7
                  notifications: hide
                  voice: false
                  menu: show
                  options: show
              - conditions:
                  user_agent: iPhone
                config:
                  show_tabs: 8 to 17
                  notifications: hide
                  voice: false
                  menu: hide
                  options: hide
                  swipe: true
                  swipe_wrap: true
                  swipe_animate: swipe
                  swipe_prevent_default: true
                  swipe_amount: 20

Swipe from edge on iOS/safari happens at the OS/app level and cannot be prevented unfortunately.

Figured that was the case. You might want to add this tidbit as a note to iOS users on the wiki. I suspect I won’t be the only one who inquires about this.

Thanks for the quick response.

1 Like

Updates v1.0.4:

  • Hyphen no longer required for single entries to conditional templates.
  • Provide logs on conditional template errors.
  • Prevent conditional styling to header while in edit mode.
  • Swipe navigation now ignores swipes on header (would previously animate, but not navigate).
2 Likes

Yes that works for me, thanks.

But…

I am being plagued by errors in my logs

http://192.168.1.25:8123/frontend_latest/app.7bd99ba1.js:2:60391 Uncaught TypeError: Cannot convert undefined or null to object
Connection lost. Reconnecting…

Which I hate to say I think might be being caused by CCH.

Now, I have spent a good few hours on this today, commenting out sections and reloading, adding card-loader, removing all custom cards and frankly I am not sure anymore if I am coming or going. However eventually I decided to remove CCH and I think the errors went away.

Take good note of my use of italics because I am NOT at this stage confident enough to say for sure but I would be grateful if you could consider if this is a possibility and if so how I could help you troubleshoot what is going on or provide you with anything that might help.

I had my suspicions that something was amiss after the 1.0.3 update as at least one of my views changed it’s layout apparently immediately after the upgrade for no obvious reason.
EDIT: I take this bit back, after yet more fiddling I have found out why that was happening - honestly these custom-cards have a mind of their own!

I know you are taking a step back from this so I completely understand if this is too much to ask especially if I am the only one experiencing this. However, if anyone else is reading this, with the new way the log is shown (in hassio) you might be missing the errors as they only appear once with a counter showing how many times it has happened.

1 Like