From 5175653922c46e68274ec49a1aab92a04a149acb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 6 Jun 2021 18:05:28 +0200 Subject: [PATCH] Fix compilation error --- tasmota/xdrv_12_home_assistant.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino index 36fa9bd22..7378be79c 100644 --- a/tasmota/xdrv_12_home_assistant.ino +++ b/tasmota/xdrv_12_home_assistant.ino @@ -888,7 +888,11 @@ void HAssAnnounceSensors(void) TasmotaGlobal.tele_period = tele_period_save; size_t sensordata_len = ResponseLength(); char sensordata[sensordata_len+2]; // dynamically adjust the size +#ifdef MQTT_DATA_STRING + strcpy(sensordata, TasmotaGlobal.mqtt_data.c_str()); // we can use strcpy since the buffer has the right size +#else strcpy(sensordata, TasmotaGlobal.mqtt_data); // we can use strcpy since the buffer has the right size +#eindif // ******************* JSON TEST ******************* // char sensordata[512];