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

Add screen / media_query to triggers_update #864

Open
Mariusthvdb opened this issue Aug 3, 2024 · 0 comments
Open

Add screen / media_query to triggers_update #864

Mariusthvdb opened this issue Aug 3, 2024 · 0 comments
Labels
FR Feature Request

Comments

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Aug 3, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

requiring updating the button-card upon screen rotation to set various numbers in animations
like

  available: >
     [[[ return window.matchMedia('(max-width:370px)').matches &&
                window.matchMedia('(orientation:portrait)').matches
         ? 25 : 36; ]]]

which currently cant be done, as there is no entity for those properties, hence the template wont update other than on reload of the view

Describe the solution you'd like
A clear and concise description of what you want to happen.
aadd window/screen/media_query to triggers_update

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

only other workaround now is duplicate the card, and set type: conditional or layout card, as documented extensively in https://community.home-assistant.io/t/how-to-make-scroll-time-speed-and-translatex-string-length-dependent-in-css-animation/754407/8

  - type: conditional
    conditions:
      - condition: screen
        media_query: "(min-width:400px)"
    card: !include /config/dashboard/includes/button/button_marquee_alerts_css_wide.yaml
  - type: conditional
    conditions:
      - condition: screen
        media_query: "(max-width:399px)"
      - condition: screen
        media_query: "(orientation:portrait)"
    card: !include /config/dashboard/includes/button/button_marquee_alerts_css_narrow.yaml

Additional context
Add any other context or screenshots about the feature request here.
see link to community above.

All it would take is the button-card to update on those screen orientations/sizing of the view

Hope you can consider,
thanks!

@Mariusthvdb Mariusthvdb added the FR Feature Request label Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FR Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant