diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index 6ccc040a95..f05e1176b5 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -424,8 +424,10 @@ class HuiMapCard extends LitElement implements LovelaceCard { } const computedStyles = getComputedStyle(this); color = getColorByIndex(this._colorIndex, computedStyles); - this._colorIndex++; - this._colorDict[entityId] = color; + if (color) { + this._colorIndex++; + this._colorDict[entityId] = color; + } return color; }