thomasloven / lovelace-card-mod

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

Glance card w/o card-mod opened in UI Editor: errors in Code Inspector #348

Open ildar170975 opened 5 months ago

ildar170975 commented 5 months ago

My Home Assistant version: 2024.1.1

My lovelace configuration method (GUI or yaml): storage

What I am doing: Creating a Glance card w/o card-mod in UI Editor.

What I expected to happen: No errors in Code Inspector & UI Editor.

What happened instead:

  1. Errors are shown in UI Editor (seems to be unrelated to card-mod & may be reproduced on a system w/o card mod - see https://github.com/home-assistant/frontend/issues/19325):

Visual editor is not supported for this configuration: Key 'entities.0.show_state' is not expected or not supported by the visual editor. The provided value for 'entities.0' is not supported by the visual editor. We support (string) but received ({"entity":"sun.sun","name":"Front 1","show_state":false}). Key 'entities.1.show_state' is not expected or not supported by the visual editor. The provided value for 'entities.1' is not supported by the visual editor. We support (string) but received ({"entity":"sun.sun","name":"Front 2","show_state":false}). Key 'entities.2.show_state' is not expected or not supported by the visual editor. The provided value for 'entities.2' is not supported by the visual editor. We support (string) but received ({"entity":"sun.sun","name":"Front 3","show_state":false}). You can still edit your config in YAML.

  1. Errors are shown in Code Inspector:

Card-mod r: At path: entities.0 -- Expected the value to satisfy a union of object | string, but received: [object Object] at d (http://192.168.220.32:8123/frontend_latest/38768.-gCP239u5SQ.js:1:2807) at f (http://192.168.220.32:8123/frontend_latest/38768.-gCP239u5SQ.js:1:2615) at F.value (http://192.168.220.32:8123/frontend_latest/20207.KXnjAt08q54.js:2:13710) at F.value (http://192.168.220.32:8123/hacsfiles/lovelace-card-mod/card-mod.js:1:59842) at F.i (http://192.168.220.32:8123/hacsfiles/lovelace-card-mod/card-mod.js:1:52936) at t.setConfig (http://192.168.220.32:8123/hacsfiles/lovelace-layout-card/layout-card.js?hacstag=156434866244:215:1564) at F.i [as setConfig] (http://192.168.220.32:8123/hacsfiles/lovelace-card-mod/card-mod.js?hacstag=190927524341:1:53062) at F.value (http://192.168.220.32:8123/frontend_latest/21948.wVYWKAjUy9c.js:1:15379) at F.value (http://192.168.220.32:8123/frontend_latest/21948.wVYWKAjUy9c.js:1:11120) at F.value (http://192.168.220.32:8123/frontend_latest/21948.wVYWKAjUy9c.js:1:10811)

With no UI Editor open after browser's refresh (F5) - no errors:

image

With UI Editor open: image

Minimal steps to reproduce:

type: glance
entities:
  - entity: sun.sun
    name: Front 1
    show_state: false
  - entity: sun.sun
    name: Front 2
    show_state: false
  - entity: sun.sun
    name: Front 3
    show_state: false

Error messages from the browser console:


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