mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-09 17:37:46 +00:00
Support button feature for input_button (#26444)
This commit is contained in:
parent
1cd0fae84a
commit
e0246b8488
@ -21,7 +21,7 @@ export const supportsButtonCardFeature = (
|
||||
: undefined;
|
||||
if (!stateObj) return false;
|
||||
const domain = computeDomain(stateObj.entity_id);
|
||||
return ["button", "script"].includes(domain);
|
||||
return ["button", "input_button", "script"].includes(domain);
|
||||
};
|
||||
|
||||
@customElement("hui-button-card-feature")
|
||||
@ -43,7 +43,8 @@ class HuiButtonCardFeature extends LitElement implements LovelaceCardFeature {
|
||||
if (!this.hass || !this._stateObj) return;
|
||||
|
||||
const domain = computeDomain(this._stateObj.entity_id);
|
||||
const service = domain === "button" ? "press" : "turn_on";
|
||||
const service =
|
||||
domain === "button" || domain === "input_button" ? "press" : "turn_on";
|
||||
|
||||
this.hass.callService(domain, service, {
|
||||
entity_id: this._stateObj.entity_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user