Giter VIP home page Giter VIP logo

Comments (2)

Aleborg avatar Aleborg commented on June 11, 2024

I just now noticed that the decluttering card use javascript for variables so it won't be possible to pass those into jinja which lovelace_gen is using, so I guess one of these 2 has to be excluded from my code.

So now the question is how to solve this problem. Instead of an example like above I'll show you one of my real case scenarios.

I'm using tabbed-card and what I need is to show/hide tabs depending on the existence of entities in an area.
So let's say I have 2 tabs:

  type: custom:tabbed-card
  tabs:
    # LIGHTS - section
    ##########
    - card:
        - type: custom:auto-entities
          card:
            type: entities
          filter:
            - domain: light
              area: '{{area_name}}' # this comes from another file using lovelace_gen's !include
      attributes:
        label: 'Lights'

    - card:
    # MEDIA - section
    ##########
        - type: custom:auto-entities
          card:
            type: entities
          filter:
            - domain: media_player
              area: '{{area_name}}' # this comes from another file using lovelace_gen's !include
      attributes:
        label: 'Media'

If there's no light entities, then the LIGHTS - section shouldn't be shown, that includes the - cardpart that starts the section (each - card is a tab). Same goes for the MEDIA - section.

I tried using decluttering card and card-mod to add the css display: none, it works, but to get it to actually work in a browser I had to do a hard refresh (ctrl+r) of the page every time cause it starts with showing all the tabs, after the refresh it would hide the tab.

So any ideas on how to solve this problem?
This is for my custom dashboard Aleborg Frontend.
I really wish that they could add templating possibilities to the frontend...

from decluttering-card.

Aleborg avatar Aleborg commented on June 11, 2024

Solved https://community.home-assistant.io/t/problem-with-decluttering-card-and-lovelace-gen-together/548789

from decluttering-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.