Closed tomlut closed 8 months ago
This only appears to be an issue in Firefox. Safari and Chrome load the theme as expected.
Hi. I got the same behavior, but for view backgrounds (not updating the background when theme is changed by automation). This is since 2021.11.5 but since that upgrade I also upgraded to card-mod 3.1.1 and I switched from a lovelace.resources.module
to the recommended frontend.extra_module_url
. I use Chrome. Same behavior on IOS app.
day:
card-mod-theme: day
card-mod-root: |
hui-view {
background: none !important;
}
ha-app-layout {
background-position: center !important;
background-size: cover !important;
background-repeat: no-repeat !important;
background-image: url("/local/images/wallpaper_triangles.jpg") !important;
background-attachment: fixed !important;
}
... etc ...
Night theme is same, but with other image. I update via service: frontend.set_theme
.
I did find a clue here. Someone had background issue when only having the frontend.extra_module_url
and not the lovelace.resources.module
. But having the module loaded by lovelace.resources.module
as well as frontend.extra_module_url
didn't help for me.
@thomasloven I hate to be a pest but can anything be done about this?
Like gurbyz above using both loading methods does not fix this for me.
Turning on "Automatically close connection" in my profile negates this issue as the page reloads when I switch to the tab showing home assistant.
Turning on "Automatically close connection" in my profile negates this issue as the page reloads when I switch to the tab showing home assistant.
I personally can't use this solution because I get the issue on a dashboard monitor that is in kiosk mode (no use of browser tabs there). But, inspired by your reload, I found another solution. Not so elegant to look at, because the dashboard just refreshes its complete browser. I'm using another integration of @thomasloven for this: browser_mod
I added this service call to the 'select theme' automations action:
- service: browser_mod.window_reload
data:
deviceID:
- browser_dashboard
Can you please check if this is still a problem in 3.4.0?
It is indeed fixed. Thank you Thomas. 👍
My Home Assistant version: 2021.11.5
My lovelace configuration method (GUI or yaml): GUI
What I am doing: Changing card-mod themes with an automation.
What I expected to happen: Card backgrounds to change.
What happened instead: Card backgrounds do not update until the page is refreshed. Behaviour was introduced in card-mod v3.1.1 and has been absent since this issue was previously resolved here: https://github.com/thomasloven/lovelace-card-mod/issues/66#issuecomment-788791065
Day theme:![Screenshot 2021-11-26 at 20-45-54 Administration - Home Assistant](https://user-images.githubusercontent.com/10679300/143560982-2bad397d-d763-480e-b235-9069672daf81.png)
Night theme selected but card backgrounds do not update:![Screenshot 2021-11-26 at 20-46-05 Administration - Home Assistant](https://user-images.githubusercontent.com/10679300/143561045-73353583-5bdf-4465-a433-e6b07b092e21.png)
After a page refresh the backgrounds are displayed correctly:![Screenshot 2021-11-26 at 20-46-19 Administration - Home Assistant](https://user-images.githubusercontent.com/10679300/143561119-c3a53e5a-d267-4384-b873-4080c123563c.png)
Minimal steps to reproduce: See config below
The issue occurs when changing the theme with an automation. Only the card backgrounds fail to update.
automation
input select
themes
Error messages from the browser console: none
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.