`card_mod` styles not being re-injected after HA state change
See original GitHub issueIs your feature request related to a problem? Please describe.
I’m using custom:frigate-card-menu-icon
to toggle input_boolean
entity state which hides/unhides conditional Picture Elements in Frigate Lovelace card views. For Picture element icon I’m using usual icon
type but for text after the icon I’m using card-mod
with ::after
selector. The problem I’m having is that when I hide elements, switch/refresh a view and then toggle elements again, card-mod
won’t get injected until I press menu button for view. I think this GIF would make more sense for you:
Describe the solution you’d like
I think you know better how to solve this, but I can suggest adding special action to custom:frigate-card-action
to refresh current view that acts just like when you press menu button for view. Though I don’t know if that would solve anything, because I tried Defining multiple actions for Elements to toggle the elements and switch the view, but it didn’t work for me(maybe there is a need for some delay before view is switched).
elements:
- type: custom:frigate-card-menu-icon
icon: mdi:information
tap_action:
- action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.switch_elements
- action: custom:frigate-card-action
frigate_card_action: image
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
I actually thought same thing at first and wanted to suggest, but considered there’s an easier approach for fixing this issue.
Also, I don’t know if you noticed this thing, but somehow it renders elements fine when toggling state(outside of card or with custom menu button) without changing the view. I noticed in Web Inspector that elements disappear when they don’t meet the condition, but when they do, they reappear again with card-mod injected. Is there an explanation why it’s working fine that way?
Maybe we can use(if possible) this behaviour for moving forward with this? If not, then option 2 is the only way I can think of now.
P.S I really appreciate your work and time with this issue(and with whole card). You’re amazing!
[Not ignoring this, it’s just a pretty advanced usecase so going to dig into the other v3-rc.1 issues first. Thanks for reproduction config!]