mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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");
|
||||
}
|
||||
|
||||
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 = {
|
||||
tap_action: {
|
||||
action: "more-info",
|
||||
},
|
||||
icon_tap_action: {
|
||||
action: supportToggle ? "toggle" : "more-info",
|
||||
action: supportsIconAction ? "toggle" : "more-info",
|
||||
},
|
||||
...config,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user