thomasloven / lovelace-card-mod

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

Sporadic warnings in log referencing invalid input_selection options #195

Closed lmagyar closed 2 years ago

lmagyar commented 2 years ago

My Home Assistant version: 2022.4.0

My lovelace configuration method (GUI or yaml): yaml

What I am doing:

Modifying input_select's css with card_mod.

What I expected to happen:

What happened instead:

Sometimes the frontend (Win Chrome and Android app also) tries to set an input_select to an empty option that causes this error in the core:

2022-04-08 08:40:38 WARNING (MainThread) [homeassistant.components.input_select] Invalid option:  (possible options: Default, Preheat)

There is an issue in frontend https://github.com/home-assistant/frontend/issues/11991 and they made a fix to check not to send empty values, though this is still happening.

The frontend team guessed that maybe some children rendering order causes this problem (I'm not a web developer).

After the April 1 joke I have a hunch, that maybe card_mod interferes with the rendering of the input_select.

Sometimes my HA UI chrome thread hangs (100% CPU core usage) and I have to kill it. Maybe this is related, maybe not.

Minimal steps to reproduce:

Currently there are no deterministic steps to reproduce this, so some help needed to log it. Though within a few hours this happens.

This is how I modify the entities/entity cards:

      type: entities
      style: |
        ha-card {
          --mdc-select-fill-color: var(--card-background-color);
        }
      entities:
        - entity: input_select.schedule_preset
          style:
            hui-generic-entity-row ha-select$: |
              #label {
                display: none;
              }
              .mdc-select__anchor {
                height: 38px !important;
              }
              .mdc-select__anchor::before {
                height: 23px !important;
              }
              .mdc-line-ripple::before, .mdc-line-ripple::after {
                border-bottom-style: none !important;
              }
              .mdc-select__dropdown-icon {
                margin-left: 0px !important;
                margin-right: 0px !important;
              }

Error messages from the browser console:


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

breakthestatic commented 2 years ago

FYI, I'm not using lovelace-card-mod, but am also still seeing the aforementioned issue; seems unlikely that the issue resides in this mod.

ildar170975 commented 2 years ago

@lmagyar I suggest to remove card-mod code and see what is happening.

lmagyar commented 2 years ago

FYI, I'm not using lovelace-card-mod, but am also still seeing the aforementioned issue; seems unlikely that the issue resides in this mod.

OK, false alarm, closing.