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

Μultiple user agents per condition #219

Closed nassost79 closed 4 years ago

nassost79 commented 4 years ago

So that we could use for example user_agent: Windows, TB-X705L and not having to repeat the same configs.

maykar commented 4 years ago

This is definitely something I will be adding. In case anyone is in a similar situation and doesn't want to wait for this to be added, I highly recommend decluttering-card to cut down on any code that you find yourself repeating in your lovelace config.

maykar commented 4 years ago

I've been working on adding this when I realized that this is already possible and exactly the reason that the template condition exists. So, after some thought I've decided not to add this as it's not necessary and I need to cut down on feature bloat.

To do this currently you would use something like the code below:

  exceptions:
    - conditions:
        template: "{{ 'Windows' in userAgent or 'TB-X705L' in userAgent}}"
      config: