And you may agree, AI isnāt helping with those user-errors.
itās really simpleā¦
1 find the right element to modify
2 use the correct syntax (always test jinja in the template editor)
result: no errors
Or a referenced database like the Jinga validation websites, but for card_mod.
Very interesting idea!
You mean actually learn what the code does? Crazy talk
sorry, ridiculous idea. Let me strike that.
Not.
btw the problem of online jinja validators always is they dont have your entities⦠so why use that when you can use the validator in HA itself?
also, I dont think we want to bloat card-mod with all of that extra computation. It signals when there is a wrong template, or a referencing issue. With that the user should be good to go.
Currently there is a code issue that I have a fix for. It usually rears it head when cards are added dynamically like in Browser Mod.
However falling asleep last night I did have the idea of card-mod style database to simplify application of mods for well know scenarios. Very sketchy ideas at this stage.
ok cool, keep us posted. glad to help, goes without saying
I have thrown a lot into my test Dashboard with multiple copies of the same card but canāt replicate. What custom components / dashboard plugins do you have? Anything that would generate an updated of a card (Lit Element) will make card-mod revealuate the card for applying styles. I know this can cause issue with using card-mod with Browser Mod, but yet to see a straight up card-mod example that I can apply my known issue to. Throttling Chrome to a snails pace also cannot reproduce the issue. So there must be more to it than a simple replicate of your card only.
Thanks for checking. I have āPower Flow Card Plusā, āCustom Card Featuresā and āKiosk Modeā installed and used on the dashboard, apart from that everything is factory.
I noticed that this happens usually after a fresh start. So i took out my macbook which was not used in a couple of days, loaded up my dashboard(it still remembered that i was logged in) and the styles were not applied:
In the logs i can still see that it was initialized:
Also now i just noticed that this happens in the primary dashboard(Overview). If i switch to a different dashboard that has the same exact entity setup, the styles are applied there:
But if i go back to the main overview dashboard, it wonāt trigger a refresh.
Then i tried to open my gate to see of that triggers an update, but sadly no. Even though the state changes(you can see the lock icon is orange and open), the styles are not applied/refreshed.
Then i just simply hit refresh(F5, not even Ctrl+F5), and it was working immediately:
Now iām trying in different browsers but canāt replicateā¦
Features are now built in for Tile cards and your issues may be āKiosk Modeā related vs card mod.
I note you are getting the performance warning in your log. Can you try the instructions in the readme to load as a module. (I also have Browser Mod installed which does this directly).
Iām using the custom card features to show a separate up and down button for my rolling shutter(itās not setup as a cover, just a RF remote for the up and down button using a Broadlink RM4 Pro).
I do have this in my config, but he above mentioned event still gets logged to my console:
frontend:
themes: !include_dir_merge_named themes
extra_module_url:
- /hacsfiles/lovelace-card-mod/card-mod.js
It will do that now. 3 different entities in this card
features:
- type: custom:service-call
entries:
- type: button
tap_action:
action: toggle
target:
entity_id:
- light.night_stand
data: {}
icon: mdi:arrow-up-bold
- type: button
icon: mdi:arrow-down-bold
tap_action:
action: toggle
target:
entity_id:
- light.bathroom_lights
data: {}
type: tile
entity: light.toilet_lights
features_position: bottom
vertical: false
Check what is exactly listed in Dashboard resources and include the EXACT same URL in extra_module_url
. Otherwise your Browser may treat as different javascript.
EDIT: If you can inspect elements of the page, you should see an early script include such as
<script>import("/browser_mod.js?2.4.0");import("/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524344");import("/hacsfiles/iconset.js");</script>
You will also see a later <script async ....>
tag for card-mod later - this is the dashboard resouce load.
Under sources in Browser inspector you should see only one card-mod js.
Not to squash your advice, but I have never had to have those settings in my config
If you are not getting the performance warning then your environment is loading fine. However as the OP is getting the peformance warning, I am providing some advice to check as different browsers can load in different ways, and is also depedent on page size etc.
EDIT: Tested with various mismatches and for me, like you say, it doesnāt seem to matter. However it is something to always look at when checking on the card-mod performance warning.
Now iām checking and i donāt see the console event mentioning this when the styles are working, so i guess it does work? Just not always
I suggest that does point to a javascript timing loading issue, which I believe can be minimsed/corrected (not sure will do more research) if the resource and frontend URLS match exactly.
Extra thought is that without the cache busting hacstag, the browser may be using an older cached version of card-mod.js
. So if you have not cleared your cache recently, it may be a good idea to do so. To assist with browsers not using old files, itās always best to follow the cache busting mechanism of HACS for the URL for frontend url.
Sound advice and we should probably know if he is in YAML mode or UI
If YAML then this makes sense
extra_module_url:
- /hacsfiles/lovelace-card-mod/card-mod.js
Chromeās DevTools will highlight the errors