diff --git a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts index 5b6687e171..b71649327d 100644 --- a/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-gauge-card-editor.ts @@ -10,7 +10,6 @@ import { number, object, optional, - refine, string, } from "superstruct"; import { fireEvent } from "../../../../common/dom/fire_event"; @@ -23,6 +22,7 @@ import type { GaugeCardConfig } from "../../cards/types"; import { ACTION_RELATED_CONTEXT, type UiAction, + supportedActions, } from "../../components/hui-action-editor"; import type { LovelaceCardEditor } from "../../types"; import { actionConfigStruct } from "../structs/action-struct"; @@ -57,13 +57,11 @@ const cardConfigStruct = assign( theme: optional(string()), needle: optional(boolean()), segments: optional(array(gaugeSegmentStruct)), - tap_action: optional( - refine(actionConfigStruct, TAP_ACTIONS.toString(), (value) => - TAP_ACTIONS.includes(value.action) - ) + tap_action: optional(supportedActions(actionConfigStruct, TAP_ACTIONS)), + hold_action: optional(supportedActions(actionConfigStruct, TAP_ACTIONS)), + double_tap_action: optional( + supportedActions(actionConfigStruct, TAP_ACTIONS) ), - hold_action: optional(actionConfigStruct), - double_tap_action: optional(actionConfigStruct), }) );