mlamberts78/weather-chart-card

Resource name conflict with "weather-card"

Closed this issue · 0 comments

Describe the bug
I am a long timer user of Bram Kragten's weather-card and have recently added this plugin (weather-chart-card) to my Home Assistant installation. When I attempt to edit an existing weather-card or create a new weather-card, the visual editor for weather-card does not show up an I receive the following error (screenshot further below):

Configuration errors detected:
Failed to execute 'define' on 'CustomElementRegistry': the name "weather-card-editor" has already been used with this registry

At the same time, visual editor for weather-chart-card works fine. Removing weather-chart-card (and restarting Home Assistant) resolves the issues for weather-card. It appears like the two plugins are in conflict.

I performed a recursive search on the custom_components directory and as can be expected both weather-card and weather-chart-card register their visual editor using the key "weather-card-editor".

I assume that whether this bug affects weather-card or weather-chart-card depends on the plugin load order which may not be deterministic which would imply that this bug can manifest differently (i.e. the bug might disable weather-chard-card's editor instead).

I am filing this as a bug to weather-chart-card since weather-card is older and therefore, in a sense, "owns" this visual editor key ;-)

To be honest, the real solution would be to not have a global registry of visual editors in Home Assistant, but this is out of scope for this bug report. I suggest to either modify the key used by weather-chart-card to something more unique to this plugin or at least document the incompatibility somewhere in this plugins documentation.

To Reproduce
Steps to reproduce the behavior:

  1. Install weather-card
  2. Install weather-chart-card
  3. Attempt to visually configure both cards

Expected behavior
Visual editor should work for both cards.

Screenshots
image

Desktop (please complete the following information):

  • weather-card version 1.5.0, installed using HACS
  • weather-chart-card version 2.4.2, installed using HACS
  • Home Assistant 2024.03 (using HASS)
  • OS: Windows, Android
  • Browser: Firefox, Firefox Mobile, Android App

Additional context
n/a