Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: add useragent as entity option #76

Open
Mariusthvdb opened this issue Feb 28, 2022 · 0 comments
Open

FR: add useragent as entity option #76

Mariusthvdb opened this issue Feb 28, 2022 · 0 comments

Comments

@Mariusthvdb
Copy link

Mariusthvdb commented Feb 28, 2022

in https://github.com/thomasloven/lovelace-state-switch#state-matching

which would be awesome because allowing switching based on browser type. Use case: trying to show a view and /or cards based on the user agent of the Chrome browser, which is the only one that can Cast.

if we could use

type: custom:state-switch
entity: useragent
states:
# [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15]
  "safari":
    type: markdown
    content: >
      This can not show type:cast
# [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 
  "chrome":
    type: markdown
    content: >
      This browser can Cast
# Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0
  "firefox":
    type: markdown
    content: >
      This can not show type:cast

Ive filed a FR( in the HA Frontend repo for the view option based on hide_if_unavailable: true but that has been unanswered. Second best thing would be showing a card based on that, or based on user agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant