mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-19 10:57:19 +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 = {
|
||||
tap_action: { action: "more-info" },
|
||||
hold_action: { action: "more-info" },
|
||||
...config,
|
||||
};
|
||||
}
|
||||
|
@ -39,20 +39,28 @@ const SCHEMA = [
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "hold_action",
|
||||
selector: {
|
||||
ui_action: {
|
||||
default_action: "more-info",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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: "",
|
||||
type: "optional_actions",
|
||||
flatten: true,
|
||||
schema: (["hold_action", "double_tap_action"] as const).map(
|
||||
(action) => ({
|
||||
name: action,
|
||||
schema: [
|
||||
{
|
||||
name: "double_tap_action",
|
||||
selector: {
|
||||
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");
|
||||
}
|
||||
|
||||
this._config = { tap_action: { action: "more-info" }, ...config };
|
||||
this._config = {
|
||||
tap_action: { action: "more-info" },
|
||||
hold_action: { action: "more-info" },
|
||||
...config,
|
||||
};
|
||||
}
|
||||
|
||||
protected render() {
|
||||
|
@ -29,7 +29,11 @@ export class HuiImageElement extends LitElement implements LovelaceElement {
|
||||
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(
|
||||
"clickable",
|
||||
|
@ -60,7 +60,11 @@ export class HuiStateBadgeElement
|
||||
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 {
|
||||
|
@ -60,6 +60,7 @@ export class HuiStateIconElement extends LitElement implements LovelaceElement {
|
||||
this._config = {
|
||||
state_color: true,
|
||||
tap_action: { action: "more-info" },
|
||||
hold_action: { action: "more-info" },
|
||||
...config,
|
||||
};
|
||||
}
|
||||
|
@ -56,7 +56,11 @@ class HuiStateLabelElement extends LitElement implements LovelaceElement {
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user