button-card icon indicating copy to clipboard operation
button-card copied to clipboard

Hide "chips" depending on the state of a device

Open zeular opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. The basic idea is that I want to be able to change to anothet template depending on the state of a device.

Describe the solution you'd like I think it should look like this:

  chips_carheater:
    template: |
        [[[
        if (states['switch.on_off_plug_in_unit_32'] == 'on'){
        return chips; 
        }else{
        return chips_hide; }        
        ]]]       

chips and chips_hide are two diffrent templates.

Describe alternatives you've considered I check the instructions and can not see that it is possible to use JS in template.

Additional context

zeular avatar Oct 31 '21 08:10 zeular

That is not possible unfortunately as the template is only loaded once when the card initially renders.

RomRider avatar Dec 30 '21 17:12 RomRider