lovelace-card-mod icon indicating copy to clipboard operation
lovelace-card-mod copied to clipboard

entities cards need extra refesh for theme to load correctly (using card-mod-theming)

Open Mariusthvdb opened this issue 3 years ago • 7 comments

My Home Assistant version: 2022.4.0.dev20220226

My lovelace configuration method (GUI or yaml): Yaml Card-mod 3.2.1 installed via

frontend:
  themes: !include_dir_merge_named /config/frontend_themes

  extra_module_url:
    - /local/lovelace/resources/lovelace-card-mod/card-mod.js

What I am doing: related to https://github.com/home-assistant/frontend/issues/10988#issuecomment-1052134096

changing themes in Lovelace, and have card-mod-theme in place

What I expected to happen:

all cards changing theme

What happened instead:

when changing themes, entities cards need an extra refresh to load the new theme. A reload of the page solves this. Minimal steps to reproduce:

# The least amount of code possible to reproduce my error, having 

Dark blue:

  <<: &generic
    card-mod-theme: custom-header
# rest of these settings
# End of code

Error messages from the browser console:


with card-mod-theme line, needs reload for theme change on entities:

Feb-26-2022 16-51-41

without, direct theme change on all, including entities:

Feb-26-2022 16-54-25

By putting an X in the boxes ([]) below, I indicate that I:

  • [X] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • [X] Have made sure I am using the latest version of the plugin.

  • [X] Have followed the troubleshooting steps of the "Common Problems" section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • [X] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Mariusthvdb avatar Feb 26 '22 15:02 Mariusthvdb

Similar issue? https://github.com/thomasloven/lovelace-card-mod/issues/163

tomlut avatar Mar 09 '22 09:03 tomlut

just tested this with the new 3.1.3 card-mod version and it seems fixed !

could it be this update made the difference here, or has something changed in HA Lovelace frontend?

Mariusthvdb avatar Mar 16 '22 08:03 Mariusthvdb

Sadly, not for me.

tomlut avatar Mar 16 '22 09:03 tomlut

aw thats too bad, just checked it again and can only say in any browser, including Safari (!) the themes change correctly.

Mariusthvdb avatar Mar 16 '22 10:03 Mariusthvdb

not sure if we still need this? I can no duplicate any longer. 2024.3 (beta) and all is ok. @tomlut Tom could you please check, Id rather close if it were for me

Mariusthvdb avatar Mar 04 '24 15:03 Mariusthvdb

Yeah it's still broken for me. If I have a view open when my theme changes from day to night or vice versa I get a weird combination of both that needs a page refresh to fix.

tomlut avatar Mar 04 '24 19:03 tomlut

Ive just noticed something like that during the current beta 2024.3.

However, to me that seems to be a core Theme issue, and in my case has nothing to do with card-mod.

I had set energy colors in the theme, and only half of the energy panel changed to those colors when reloading Theme. And also next. all without card-mod involved. see: https://discord.com/channels/330944238910963714/427516175237382144/1214339675339100241

Mariusthvdb avatar Mar 05 '24 08:03 Mariusthvdb