mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Restore default hold action for some cards (#24947)
This commit is contained in:
parent
2ccc5355c4
commit
dec968af54
@ -106,6 +106,7 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
this._config = {
|
this._config = {
|
||||||
tap_action: { action: "more-info" },
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
...config,
|
...config,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -39,20 +39,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -44,20 +44,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -37,20 +37,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -49,20 +49,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -49,20 +49,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -71,20 +71,28 @@ const SCHEMA = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "hold_action",
|
||||||
|
selector: {
|
||||||
|
ui_action: {
|
||||||
|
default_action: "more-info",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "",
|
name: "",
|
||||||
type: "optional_actions",
|
type: "optional_actions",
|
||||||
flatten: true,
|
flatten: true,
|
||||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
schema: [
|
||||||
(action) => ({
|
{
|
||||||
name: action,
|
name: "double_tap_action",
|
||||||
selector: {
|
selector: {
|
||||||
ui_action: {
|
ui_action: {
|
||||||
default_action: "none" as const,
|
default_action: "none",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
),
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -31,7 +31,11 @@ export class HuiIconElement extends LitElement implements LovelaceElement {
|
|||||||
throw Error("Icon required");
|
throw Error("Icon required");
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config = { tap_action: { action: "more-info" }, ...config };
|
this._config = {
|
||||||
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
|
...config,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
@ -29,7 +29,11 @@ export class HuiImageElement extends LitElement implements LovelaceElement {
|
|||||||
throw Error("Invalid configuration");
|
throw Error("Invalid configuration");
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config = { tap_action: { action: "more-info" }, ...config };
|
this._config = {
|
||||||
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
|
...config,
|
||||||
|
};
|
||||||
|
|
||||||
this.classList.toggle(
|
this.classList.toggle(
|
||||||
"clickable",
|
"clickable",
|
||||||
|
@ -60,7 +60,11 @@ export class HuiStateBadgeElement
|
|||||||
throw Error("Entity required");
|
throw Error("Entity required");
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config = { tap_action: { action: "more-info" }, ...config };
|
this._config = {
|
||||||
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
|
...config,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
||||||
|
@ -60,6 +60,7 @@ export class HuiStateIconElement extends LitElement implements LovelaceElement {
|
|||||||
this._config = {
|
this._config = {
|
||||||
state_color: true,
|
state_color: true,
|
||||||
tap_action: { action: "more-info" },
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
...config,
|
...config,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,11 @@ class HuiStateLabelElement extends LitElement implements LovelaceElement {
|
|||||||
throw Error("Entity required");
|
throw Error("Entity required");
|
||||||
}
|
}
|
||||||
|
|
||||||
this._config = { tap_action: { action: "more-info" }, ...config };
|
this._config = {
|
||||||
|
tap_action: { action: "more-info" },
|
||||||
|
hold_action: { action: "more-info" },
|
||||||
|
...config,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
protected shouldUpdate(changedProps: PropertyValues): boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user