mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Use toggle as default icon_tap_action for scenes and buttons in tile card (#14386)
This commit is contained in:
parent
aa1e9cedca
commit
d6fa1427f1
@ -73,14 +73,17 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
|||||||
throw new Error("Specify an entity");
|
throw new Error("Specify an entity");
|
||||||
}
|
}
|
||||||
|
|
||||||
const supportToggle = DOMAINS_TOGGLE.has(computeDomain(config.entity));
|
const domain = computeDomain(config.entity);
|
||||||
|
const supportsIconAction =
|
||||||
|
DOMAINS_TOGGLE.has(domain) ||
|
||||||
|
["button", "input_button", "scene"].includes(domain);
|
||||||
|
|
||||||
this._config = {
|
this._config = {
|
||||||
tap_action: {
|
tap_action: {
|
||||||
action: "more-info",
|
action: "more-info",
|
||||||
},
|
},
|
||||||
icon_tap_action: {
|
icon_tap_action: {
|
||||||
action: supportToggle ? "toggle" : "more-info",
|
action: supportsIconAction ? "toggle" : "more-info",
|
||||||
},
|
},
|
||||||
...config,
|
...config,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user