New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Card configuration change #6
Comments
Hi. A change in how lovelace cards are set up in Home Assistant 0.105 increases performance, but enables cards to accidentally modify their own configuration in the loaded lovelace configuration. I'm going through the cards in the HACS default repository, and noticed that your card may be susceptible to this. Looking through your code it seems you may modify parts of the config object passed to your card in The result could be that your card does not work well with the GUI editors or that parts of the configuration start showing up multiple times. At some point in the future, it is likely that the configuration will be frozen before being passed to There are several ways to fix/protect agains this problem. The best is to restructure setConfig(config) {
config = { ...config }; // This works for simple configurations not containing arrays or objects
... import { deepClone } from "deep-clone-simple";
// https://github.com/balloob/deep-clone-simple
setConfig(config) {
config = deepClone(config); // This is a safe and fast method
... or setConfig(config) {
config = JSON.parse(JSON.stringify(config)); // This uses built-in functions, but may be slower than deepClone
... Please note that I have not tested your card agains Home Assistant 0.105 or later, but just quickly looked through the code. If I'm mistaken in my assessment, I appologize for taking your time. See #6 for more info. |
FAQIs my card ok if it's checked off on this list and I didn't get an issue?Not necessarily. I only looked at your source very quickly. Is
|
More info: home-assistant/frontend#4862
amaximus/bkk-stop-card
amaximus/garbage-collection-card
AmoebeLabs/flex-horseshoe-card
Anonym-tsk/lovelace-starline-card
atomic7777/atomic_calendar
azuwis/zigbee2mqtt-networkmap
bbbenji/synthwave-hass-extras
benct/lovelace-github-entity-row
benct/lovelace-multiple-entity-row
benct/lovelace-xiaomi-vacuum-card
bokub/rgb-light-card
bramkragten/swipe-card
bramkragten/weather-card
Ceerbeerus/beerbolaget-card
chaptergy/lightalarm-card
CyrisXD/love-lock-card
DarkFox/rejseplanen-card
DavidFW1960/bom-weather-card
dcramer/lovelace-nextbus-card
dimagoltsman/content-card-remote-control
dmulcahey/zha-network-card
dnguyen800/air-visual-card
dooz127/swipe-glance-card
enriqg9/dual-thermostat
fineemb/lovelace-fan-xiaomi
fineemb/lovelace-thermostat-card⚠️
finity69x2/fan-control-entity-row
finity69x2/light-brightness-preset-row
gadgetchnnel/lovelace-card-templater
gadgetchnnel/lovelace-home-feed-card
gadgetchnnel/lovelace-text-input-row
gurbyz/power-wheel-card
hasl-platform/lovelace-hasl-departure-card
hasl-platform/lovelace-hasl-traffic-status-card
iantrich/aftership-card
iantrich/config-template-card
iantrich/podcast-card
iantrich/radial-menu
iantrich/restriction-card
iantrich/roku-card
ikaruswill/lovelace-fan-xiaomi
isabellaalstrom/krisinfo-card
isabellaalstrom/lovelace-grocy-chores-card
jonkristian/entur-card
kalkih/mini-graph-card
kalkih/mini-media-player
kalkih/simple-weather-card
ljmerza/calendar-card
ljmerza/fitbit-card
ljmerza/github-card
ljmerza/light-entity-card
ljmerza/our-groceries-card
ljmerza/reddit-card
ljmerza/tracking-number-card
ljmerza/travel-time-card
maykar/custom-header
maykar/lovelace-swipe-navigation
Mofeywalker/openmensa-lovelace-card
nervetattoo/banner-card
nervetattoo/simple-thermostat
peetereczek/ztm-stop-card
peternijssen/lovelace-postnl-card
PiotrMachowski/Home-Assistant-Lovelace-HTML-Jinja2-Template-card
PiotrMachowski/Home-Assistant-Lovelace-Local-Conditional-card
PiotrMachowski/lovelace-google-keep-card
PiotrMachowski/lovelace-html-card
PiotrMachowski/lovelace-xiaomi-vacuum-map-card
postlund/search-card
r-renato/ha-card-waze-travel-time
r-renato/hass-xiaomi-mi-flora-and-flower-care
RodBr/miflora-card
royto/logbook-card
sbryfcz/harmony-card
tcarlsen/lovelace-light-with-profiles
TheLastProject/lovelace-media-art-background
TheLastProject/lovelace-valetudo-map-card
thomasloven/lovelace-auto-entities
thomasloven/lovelace-card-mod
thomasloven/lovelace-card-tools
thomasloven/lovelace-dummy-entity-row
thomasloven/lovelace-fold-entity-row
thomasloven/lovelace-gap-card
thomasloven/lovelace-gui-sandbox
thomasloven/lovelace-layout-card
thomasloven/lovelace-more-info-card
thomasloven/lovelace-slider-entity-row
thomasloven/lovelace-state-switch
thomasloven/lovelace-template-entity-row
twrecked/lovelace-hass-aarlo
Villhellm/lovelace-animated-background
xMrVizzy/button-toolba
Custom-cards organization
The text was updated successfully, but these errors were encountered: