custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.97k stars 242 forks source link

Help with triggers_update #622

Open tanker11 opened 2 years ago

tanker11 commented 2 years ago

Not really a bug, but I don't see the difference if using it. Situation: I have many custom button cards on a main view. The cards contain a main icon and 4-8 further state icons (custom_fields) updated by javascript. Putting them after another I can see the frontend slowing down dramatically on my raspi3/chromium/kiosk client.

Then I bumped into the triggers_update and tried to improve the performance using it, but when tried, it shows no difference, the card (all entity related icons) are updated always for any change. There is something about nested cards in the custom fields, but I have only HTML icons there, no cards. For example:

type: custom:button-card entity: light.garage

[...]

custom_fields: icon1: | [[[ //move

    if (states["binary_sensor.garage_movement"].state=='on') 
    return '<ha-icon icon="mdi:run" style="width: 24px; height: 24px; color: orangered;"></ha-icon>';
    return '<ha-icon icon="mdi:blank" style="width: 24px; height: 24px; color: orangered;"></ha-icon>';      
]]]

Is there any relation to triggers_update if I add to the beginning of the code:

triggers_update: