mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Add secondary option for cover entities (#5556)
* Add secondary option for cover entities * Replace string concatenation * Check for undefined
This commit is contained in:
parent
24a844dddc
commit
c72bb5b22b
@ -29,7 +29,12 @@ export interface EntityCardConfig extends LovelaceCardConfig {
|
|||||||
|
|
||||||
export interface EntitiesCardEntityConfig extends EntityConfig {
|
export interface EntitiesCardEntityConfig extends EntityConfig {
|
||||||
type?: string;
|
type?: string;
|
||||||
secondary_info?: "entity-id" | "last-changed";
|
secondary_info?:
|
||||||
|
| "entity-id"
|
||||||
|
| "last-changed"
|
||||||
|
| "last-triggered"
|
||||||
|
| "position"
|
||||||
|
| "tilt-position";
|
||||||
action_name?: string;
|
action_name?: string;
|
||||||
service?: string;
|
service?: string;
|
||||||
service_data?: object;
|
service_data?: object;
|
||||||
|
@ -112,6 +112,16 @@ class HuiGenericEntityRow extends LitElement {
|
|||||||
: this.hass.localize(
|
: this.hass.localize(
|
||||||
"ui.panel.lovelace.cards.entities.never_triggered"
|
"ui.panel.lovelace.cards.entities.never_triggered"
|
||||||
)
|
)
|
||||||
|
: this.config.secondary_info === "position" &&
|
||||||
|
stateObj.attributes.current_position !== undefined
|
||||||
|
? `${this.hass.localize("ui.card.cover.position")}: ${
|
||||||
|
stateObj.attributes.current_position
|
||||||
|
}`
|
||||||
|
: this.config.secondary_info === "tilt-position" &&
|
||||||
|
stateObj.attributes.current_tilt_position !== undefined
|
||||||
|
? `${this.hass.localize("ui.card.cover.tilt_position")}: ${
|
||||||
|
stateObj.attributes.current_tilt_position
|
||||||
|
}`
|
||||||
: "")}
|
: "")}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user