From a5c7f261c82d3fd68f7b91d096eb1c0ba3c4d8bc Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 29 Jun 2023 17:14:05 +0200 Subject: [PATCH] dont split a string --- .../trigger/types/ha-automation-trigger-conversation.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 f5cc84d862..34a03c9ace 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 @@ -92,7 +92,11 @@ export class HaConversationTrigger private async _updateOption(ev: Event) { const index = (ev.target as any).index; - const command = [...this.trigger.command]; + const command = [ + ...(Array.isArray(this.trigger.command) + ? this.trigger.command + : [this.trigger.command]), + ]; command.splice(index, 1, (ev.target as HaTextField).value); fireEvent(this, "value-changed", { value: { ...this.trigger, command },