flixlix / power-flow-card-plus

A power distribution card inspired by the official Energy Distribution card for Home Assistant
506 stars 61 forks source link

UI visual editor is not available #441

Open snigehere opened 7 months ago

snigehere commented 7 months ago

Describe the bug When I first installed the component I got a visual editor to be able to add entities but now I get an error

To Reproduce Steps to reproduce the behavior:

  1. Add new card
  2. Card opened in YAML editor with error
  3. Visual editor is not supported for this configuration: s.entries is not a function You can still edit your config in YAML.

Expected behavior Visual editor working

Screenshots If applicable, add screenshots to help explain your problem.

Browser Console Errors If applicable, add Errors from the browser console.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

Note - the warning and work around is no longer in the readme and the ticket for card mod is closed as fixed https://github.com/thomasloven/lovelace-card-mod/issues/275 I have opened https://github.com/thomasloven/lovelace-card-mod/issues/321 in case this issue is still related to card mod as well as this ticket. When I first installed I was able to see the UI but following a restart I am seeing the error described above Snap8

flixlix commented 6 months ago

Hey, this is a known issue caused by card-mod / browser-mod. Either uninstall it, or use the yaml config. Thank you for understanding

snigehere commented 6 months ago

Hi @flixlix This is not at all clear. There was a prior issue for this with card-mod but that's marked closed. This ticket form for powercard references a readme message that has since been removed suggesting the issue was solved. I opened a further issue on card-mod referencing the original ticket. Since opening that ticket there have be updates to card-mod and to me it looks like the issue is solved although there has not been an update to my ticket against card-mod. Is there still an issue related to card-mod? I am a user of both and feel a bit stuck between as I don't really know the root issue ...

flixlix commented 6 months ago

I am not sure how this issue is caused, back then I made this PR https://github.com/thomasloven/lovelace-card-mod/pull/277 that was merged and that fixed the issue. The conflict comes from the fact that this card is using the key entities in its configuration and card mod was trying to do something to it. In my PR, I made a check to check if entities is an array that can be mapped. Since in the case of this card it is not an array, card-mod doesn't do anything to it. See: https://github.com/thomasloven/lovelace-card-mod/blob/4de5148a02d748d400bb4599c17020ca951bb64f/src/patch/hui-card-element-editor.ts#L18

If the issue came back I am not sure why. The error you sent as a screenshot is the same error I had back then. It probably comes from this line: https://github.com/thomasloven/lovelace-card-mod/blob/4de5148a02d748d400bb4599c17020ca951bb64f/src/patch/hui-card-element-editor.ts#L19

andbad commented 6 months ago

I've the same problem, but the error says: "o.entries is not a function" CardMod is installed.

By(t)e

Gelisob commented 5 months ago

Hey, this is a known issue caused by card-mod / browser-mod. Either uninstall it, or use the yaml config. Thank you for understanding

Had same problem, updating the card-mod fixed the issue for me. UI visible now

andbad commented 5 months ago

I confirm, but for some reason not showing UI on the card previously created, but only if I create a new card. Maybe, some old configuration not recognized.

By(t)e