maykar / custom-header

Custom Header adds enhancements and customization options to Home Assistant's Lovelace header.
https://maykar.github.io/custom-header
MIT License
256 stars 107 forks source link

Issue with exceptions #246

Closed v-sante closed 4 years ago

v-sante commented 4 years ago

Irrespective of the exception I set, they never seem to work. I'm trying to get them to work on the HA app on iPhone but have also just tried them on an ordinary Chrome browser.

I have tried different users, device IDs, user agents, everything. Always goes to the main configuration.

To give one example, what is conceivably wrong with this:

custom_header:
  menu_hide: true
  options_hide: true
  exceptions:
    - conditions:
        device_id: c90f4a8f-b6352da1
      config:
        menu_hide: false
        options_hide: false

I have literally copied the device_id from that shown in custom header. Why isn't it then immediately working. On this config, on the very device giving that id, both menu and options are absent when they should plainly be shown.

github-actions[bot] commented 4 years ago

Important:

Issues that don't provide the necessary information listed below may not get a reply and will be closed until the info is provided.

Release is the current version of Custom Header. Be sure that you are using the latest version by checking your browser's dev tools console (usually found by pressing F12). If this doesn't display the current version either clear your cache or reinstall.

If you haven't yet done so, please read the "Before Posting an Issue" section of the docs site.

Include as much of the following info as you can to help me replicate and investigate your issue:

When pasting in your config always place 3 backticks ``` above the first line of your config and after the last line. Doing this will format it correctly so that I may find any formatting errors in your config.

maykar commented 4 years ago

I am unable to reproduce your issue in Chrome, Firefox, Safari, iOS, or Android. A straight copy/paste of your config works as expected when replacing the condition with my own device_id, user, etc.

Please read the bots comment above and provide as much information as you can to help me troubleshoot. Mostly I'd be interested if there are any errors in either the logs or dev console, but any additional information is helpful.

v-sante commented 4 years ago

Sorry:

Dev console:

  SPOTIFY-CARD   Version 2.0.4    
custom-sidebar.js:1 Custom Sidebar is loading
custom-header.js:145   CUSTOM-HEADER    Version 1.6.9  
button-card.js:1597   BUTTON-CARD   Version 3.3.6 
2custom-header.js:145 [CUSTOM-HEADER] There was an issue with the template: "header_text_css: "font-family: "Raleway"
custom-sidebar.js:129 GET http://homeassistant.local:8123/local/sidebar-order.yaml?rnd=vat0zr3v8pgbflkkatze6 404 (Not Found)
run @ custom-sidebar.js:129
setInterval (async)
(anonymous) @ custom-sidebar.js:3
custom-sidebar.js:104 Uncaught TypeError: Cannot read property 'length' of null
    at rearrange (custom-sidebar.js:104)
    at XMLHttpRequest.req.onload (custom-sidebar.js:121)
rearrange @ custom-sidebar.js:104
req.onload @ custom-sidebar.js:121
load (async)
run @ custom-sidebar.js:119
setInterval (async)
(anonymous) @ custom-sidebar.js:3
slider-entity-row.js:68 SLIDER-ENTITY-ROW 1.0.0 IS INSTALLED 
layout-card.js:92 LAYOUT-CARD 1.3.1 IS INSTALLED 
card-mod.js:5 CARD-MOD 2.0.0 IS INSTALLED 
vertical-slider-cover-card.js:9  [konnected.vn] Vertical Slider Cover Card   Version v0.1.1
custom-header.js:145 [CUSTOM-HEADER] There was an issue with the template: "header_text_css: "font-family: "Raleway"
custom-header.js:145 Current User's Name:  Theodor van Sante
custom-header.js:145 Current User's ID:  344e6f72ba3b47818d107e62989804df
custom-header.js:145 Device ID:  c90f4a8f-b6352da1

Nothing in the HA logs at all.

HA v.0.113.3 CH v1.6.9

Chrome browser (and HA app).

Full CH yaml:

custom_header:
  active_tab_css: 'color: #CFB53B'
  all_tabs_css: 'padding: 0px 8px'
  background: var(--primary-background-color)
  chevrons: false
  compact_mode: true
  elements_color: var(--primary-text-color)
  header_text_css: 'font-family: "Raleway", Raleway, serif;'
  tab_container_css: 'padding: 0'
  tab_indicator_color: var(--primary-text-color)
  menu_hide: true
  options_hide: true
  exceptions:
    - conditions:
        device_id: c90f4a8f-b6352da1
      config:
        menu_hide: false
        options_hide: false

Theme is Light Soft UI if that is relevant - I have turned it off however and no difference.

v-sante commented 4 years ago

Have removed the Raleway line and it seems to be working. Any reason for that?

maykar commented 4 years ago

Double quotes inside the string can cause issues with the template rendering as mentioned in the important notes.

Either of these would work just fine: header_text_css: "font-family: 'Raleway', Raleway, serif;" header_text_css: 'font-family: Raleway, serif;'

v-sante commented 4 years ago

Thanks! Appreciated!