thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.06k stars 169 forks source link

Adding UI-Editor to custom card results in error #275

Closed flixlix closed 7 months ago

flixlix commented 1 year ago

My Home Assistant version: 2023.4.0b6

My lovelace configuration method (GUI or yaml):

GUI

What I am doing:

I am developing the Power Flow Card Plus and would like to add a UI-Editor.

What I expected to happen:

If Card-Mod is not installed, I can edit the configuration of my card without any issues.

What happened instead:

When Card-Mod is installed, I get the following error: Bildschirmfoto 2023-04-12 um 16 16 36

Minimal steps to reproduce:

Error messages from the browser console: Bildschirmfoto 2023-04-12 um 16 17 30


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

flixlix commented 1 year ago

I did notice this line: https://github.com/thomasloven/lovelace-card-mod/blob/b8c48b925643389fea5b1c0185ad7e0cbbd2bb76/src/patch/hui-card-element-editor.ts#L24 and this line: https://github.com/thomasloven/lovelace-card-mod/blob/b8c48b925643389fea5b1c0185ad7e0cbbd2bb76/src/patch/hui-card-element-editor.ts#L33 in the hui-car-element-editor.ts file, maybe the issue is coming from that...

flixlix commented 1 year ago

Created #277 which in my case solves the issue

ildar170975 commented 8 months ago

@flixlix Can you post a screenshot when you see this error?

Nevermind. I see that in your custom Power Flow card the entities option represents a dict, not a list (which is expected by card-mod). That is why you suggest to add a check "if the entities object is an array".

Yorkie71 commented 7 months ago

I just saw overnight that #277 was closed. @flixlix does this mean that the UI in your excellent Power Flow Plus card will now function?

flixlix commented 7 months ago

Yes, this was the new version Release Notes https://github.com/thomasloven/lovelace-card-mod/releases/tag/3.3.0

Yorkie71 commented 7 months ago

Excellent. I see it in the update list now. I should be more patient. Great work! Just updated and now I see the GUI. Nice.