From 699eb30ed56e24a1644b01605165f2982fe37c1b Mon Sep 17 00:00:00 2001 From: Benny Nestler Date: Wed, 30 Mar 2022 14:47:46 +0200 Subject: [PATCH] CHG: Refactored if-condition --- tasmota/xdrv_16_tuyamcu.ino | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index ccd4f56d7..3351355f3 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -1254,15 +1254,9 @@ void TuyaSerialInput(void) ResponseAppend_P(PSTR("}}")); if (Settings->flag3.tuya_serial_mqtt_publish) { // SetOption66 - Enable TuyaMcuReceived messages over Mqtt - if (Settings->flag5.tuya_exclude_heartbeat) { // SetOption137 - (Tuya) When Set, avoid the (mqtt-) publish of Tuya MCU Heartbeat response if SetOption66 is active - if (false == isHeartbeat) { - MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_TUYA_MCU_RECEIVED)); - } - } - else { + if (!(isHeartbeat && Settings->flag5.tuya_exclude_heartbeat)) { // SetOption137 - (Tuya) When Set, avoid the (mqtt-) publish of Tuya MCU Heartbeat response if SetOption66 is active MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_TUYA_MCU_RECEIVED)); - } - + } } else { AddLog(LOG_LEVEL_DEBUG, ResponseData()); }