Support button feature for input_button (#26444)

This commit is contained in:
karwosts 2025-08-08 22:52:14 -07:00 committed by GitHub
parent 1cd0fae84a
commit e0246b8488
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,