From 1d1ff410b267069ba08e6975a8f7eb1a015190f6 Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Wed, 28 Dec 2022 12:12:30 +0100 Subject: [PATCH] Make using template rendering optional when using MQTT publish from the config entry page (#14828) --- .../mqtt/mqtt-config-panel.ts | 30 +++++++++++++++++-- src/translations/en.json | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts index 1b09bb5cc3..0656ed360e 100644 --- a/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts +++ b/src/panels/config/integrations/integration-panels/mqtt/mqtt-config-panel.ts @@ -33,6 +33,9 @@ class HaPanelDevMqtt extends LitElement { @LocalStorage("panel-dev-mqtt-retain-ls", true, false) private _retain = false; + @LocalStorage("panel-dev-mqtt-allow-template-ls", true, false) + private _allowTemplate = false; + protected render(): TemplateResult { return html` @@ -74,7 +77,25 @@ class HaPanelDevMqtt extends LitElement { > -

${this.hass.localize("ui.panel.config.mqtt.payload")}

+

+ + + +

+

+ ${this._allowTemplate + ? this.hass.localize("ui.panel.config.mqtt.payload") + : this.hass.localize( + "ui.panel.config.mqtt.payload_no_template" + )} +