diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-conversation.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-conversation.ts index 34a03c9ace..aebc2a899e 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-conversation.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-conversation.ts @@ -10,6 +10,8 @@ import { showConfirmationDialog } from "../../../../../dialogs/generic/show-dial import { HomeAssistant } from "../../../../../types"; import { TriggerElement } from "../ha-automation-trigger-row"; +const PATTERN = "^[^.。,,?¿?؟!!;;::]+$"; + @customElement("ha-automation-trigger-conversation") export class HaConversationTrigger extends LitElement @@ -39,6 +41,12 @@ export class HaConversationTrigger iconTrailing .index=${index} .value=${option} + .validationMessage=${this.hass.localize( + "ui.panel.config.automation.editor.triggers.type.conversation.no_punctuation" + )} + autoValidate + validateOnInitialRender + pattern=${PATTERN} @change=${this._updateOption} > `; diff --git a/src/translations/en.json b/src/translations/en.json index 042ec31ac6..567c33c6e3 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -2382,6 +2382,7 @@ }, "conversation": { "label": "Sentence", + "no_punctuation": "You should not use punctuation in your sentence", "add_sentence": "Add sentence", "delete": "Delete sentence", "confirm_delete": "Are you sure you want to delete this sentence?",