Card Editor: Special Row doesn't show warning#7093
Conversation
| <div class="entity" data-entity-id=${entityConf.entity}> | ||
| <div | ||
| class="entity" | ||
| data-entity-id=${entityConf.entity || entityConf.type} |
There was a problem hiding this comment.
I don't know why TS is complaining that the entity property doesn't exist here? I thought that having the OR here would make it go away...
Its because entity doesn't exist on all of the RowConfigs
Any suggestions?
There was a problem hiding this comment.
Does it play better with a ternary expression? entityConf.entity ? entityConf.entity : entityConf.type
There was a problem hiding this comment.
I tried that too. Same issue
There was a problem hiding this comment.
"entity" in entityConf ? entityConf.entity : entityConf.type
| @value-changed=${this._valueChanged} | ||
| allow-custom-entity | ||
| ></ha-entity-picker> | ||
| ${entityConf.type |
There was a problem hiding this comment.
Thinking we might want to extend this instead, seems very strange to have something specific to only the entities card in this element.
There was a problem hiding this comment.
Probably not a bad idea
There was a problem hiding this comment.
We do that and then we can change how we add rows later as well, and give a new prompt instead allowing you choose special row or entity and expand on the entity options
There was a problem hiding this comment.
Yea that was the plan for this. I have a branch ready to do that and have entity options. But this is the first step
| @property({ attribute: false }) protected hass?: HomeAssistant; | ||
|
|
||
| @property({ attribute: false }) protected entities?: EntityConfig[]; | ||
| @property({ attribute: false }) protected entities?: LovelaceRowConfig[]; |
There was a problem hiding this comment.
This should not be in the entity-editor, as we use that for different cards, we should make a specific entities-card-row-editor that accepts a LovelaceRowConfig[]
785d24f to
b4510d5
Compare
|
New element created. Entity editor is no longer touched and stay the same for other elements using it |
| ${this.hass!.localize( | ||
| `ui.panel.lovelace.editor.card.entities.entity_row.${entityConf.type}` | ||
| )} | ||
| ${this.hass!.localize( | ||
| "ui.panel.lovelace.editor.card.entities.special_row" | ||
| )} |
There was a problem hiding this comment.
We should combine this in 1 localize:
| ${this.hass!.localize( | |
| `ui.panel.lovelace.editor.card.entities.entity_row.${entityConf.type}` | |
| )} | |
| ${this.hass!.localize( | |
| "ui.panel.lovelace.editor.card.entities.special_row" | |
| )} | |
| ${this.hass!.localize( | |
| "ui.panel.lovelace.editor.card.entities.special_row", "row_type", this.hass!.localize( | |
| `ui.panel.lovelace.editor.card.entities.entity_row.${entityConf.type}` | |
| ) | |
| )} |
But maybe we should just drop the special_row? Just "Button row" would be enough?

Proposed change
This makes it so that special Rows do not break the editor.
Type of change
Example configuration
Additional information
Checklist