Open skykingjwc opened 11 months ago
Also confirmed that using states["light.basement_light"]
instead of entity.state
in the background-color javascript template does not make a difference
Tested similar configuration using native HA Light cards and the issue does not appear to be present
+1, I experience the same problem. On top of that, if I hold-tap on a button the card (actually ALL somehow related cards) stay highlighted.
cant say I fully understand what you are describing, and the screenshot doesnt help.
but I do notice you have an odd template
- background-color: '[[[ if (entity.state =="on") return "red"; else if(entity.state == "off") return "blue"; else return "black"; ]]]'
since this if for a boolean entity, why no simply use:
- background: >
[[[ return entity.state == 'on' ? 'red' : 'blue'; ]]]
might not help, but at least its a cleaner template and you can then rule it out being the cause of your issue
Maybe the video explains more: https://github.com/custom-cards/button-card/assets/580758/bdc31b66-2128-4379-bd96-6183cba8cf45
sorry, but that has nothing to do with switching views? Maybe that title does not describe the issue very well, but now I am even more confused....
all I can see are some instable buttons flickering (cant see if that happens on a click, or just always) o wat, you said
if I hold-tap
sorry. Id suggest to write that up as a separate issue, for ease of following up
I'll do that now to mitigate the risk of hijacking this issue report.
Checklist
Describe the bug When switching views, cards briefly show incorrect background color when being set by entity state.
This causes flicker on dashboard views which share the same card. Other card set properties by state to not appear to be affected.
Version of the card Version: v4.1.1
To Reproduce This is the configuration I used: bugtest.yaml
bugview1.yaml
bugview2.yaml
Screenshots
Expected behavior Background color should be set before card is rendered as to avoid flicker when switching views
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Steps to reproduce bug
The other elements, such as the state display do not appear to be affected.