Home Assistant Community

Compact Custom Header

#208

1 Like

#209

Is it possible to hide the menu based on user_agents? I’m looking to make a faux user privileged feel by making it so certain users can’t see the menu to be able to adjust any settings. But I don’t want to hide it for my main admin account. It’d be something like this, maybe not done exactly this way, but you get my point:

- type: custom:compact-custom-header
  user_agent: admin, guest
  user_agent_views:
    - menu,1,2,3,4
    - 2,4
0 Likes

#210

This is already a feature, check out the readme for more options and use:

- type: custom:compact-custom-header
  menu: false, true      # first option is default, second is for admin...
  user_agent: admin
  user_agent_views:
    - 2,4                # tabs shown by default
    - 1,2,3,4            # admin tabs

First option will always be default, next one is the first user agent, next one is the second user agent and so on. Every config option can be set per user agent this way.

1 Like

#211

I have on iOS sometimes a strange behaviour.
Some clicks on the second tab are not recognized and I have to click the next tab before I can select my second tab (see attached video)

0 Likes

#212

Hmm. Can you confirm that this doesn’t happen without the custom header?

0 Likes

#213

sorry. need to take it back
it happens also without custom header
just now

0 Likes

#214

Looks like it’s broken in 0.86.0b2.
Seeing the normal Header in FF and Chrome.

EDIT: Back in 0.86.0b1, everthings OK.

1 Like

#215

Yeah I concur… it is broken with 0.86.0b2. (But they broke a bunch of stuff in b2 so I think this will be fixed in next beta or release)

0 Likes

#216

@DavidFW1960 & @VDRainer

No errors? Anything being reported for the card in Chrome DevTools (F12)?

0 Likes

#217

TypeError: Cannot read property ‘querySelector’ of null
at VM1345 compact-custom-header.lib.js:18

image

0 Likes

#218

Looks like either something has been renamed or moved. Will check it out when I can get on the beta

0 Likes

#219

Perhaps… they did break a few things… dunno if it’s anything you need to fix or if HA will fix it…

0 Likes

#220

0.86.0b3 and it’s still not working… They fixed the other issue so I don’t know if that means a change is needed for this card or not. 0.86 is a couple of days to release I think.

1 Like

#221

Updated to fix the 0.86 issue. Should be reasonably future proof in case things move around again.

Also fixed an issue for single tab layouts.

2 Likes

#222

Custom Updater is not showing an update yet?

0 Likes

#223

@mayker, views starting with 0 now?
Have to use 0,1,2,… to see my first view.

1 Like

#224

Oops, didn’t mean to put in that breaking change in this release, but I guess I did!

Breaking Change!

To fall in line with default lovelace URL numbering, views now start with 0 instead of 1.

1 Like

#225

Thanks for the heads up. Just updated readme to reflect the changes

1 Like

#226

I always wondered why they were different! :wink:

1 Like

#227

I, for one, welcome this breaking change! :smiley:

1 Like