From 082ba8a8e823ebce389465f6918611ef3609050a Mon Sep 17 00:00:00 2001 From: barbudor Date: Thu, 24 Mar 2022 22:56:31 +0100 Subject: [PATCH] use so136 to disable tuyasns immediate publish --- tasmota/settings.h | 2 +- tasmota/xdrv_16_tuyamcu.ino | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tasmota/settings.h b/tasmota/settings.h index 51c10d7d7..c0488a194 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -165,7 +165,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t shift595_invert_outputs : 1; // bit 19 (v10.0.0.4) - SetOption133 - (Shift595) Invert outputs of 74x595 shift registers uint32_t pwm_force_same_phase : 1; // bit 20 (v10.1.0.6) - SetOption134 - (PWM) force PWM lights to start at same phase, default is to spread phases to minimze overlap (also needed for H-bridge) uint32_t display_no_splash : 1; // bit 21 (v11.0.0.2) - SetOption135 - (Display & LVGL) forece disbabling default splash screen - uint32_t spare22 : 1; // bit 22 + uint32_t tuyasns_no_immediate : 1; // bit 22 (v11.0.0.4) - SetOption136 - (TuyaSNS) When ON disable publish single SNS value on Tuya Receive (keep Teleperiod) uint32_t spare23 : 1; // bit 23 uint32_t spare24 : 1; // bit 24 uint32_t spare25 : 1; // bit 25 diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 3c550424f..73ed1782a 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -830,7 +830,11 @@ void TuyaProcessStatePacket(void) { GetTextIndexed(sname, sizeof(sname), (fnId-71), kTuyaSensors); ResponseClear(); // Clear retained message Response_P(PSTR("{\"TuyaSNS\":{\"%s\":%s}}"), sname, dtostrfd(TuyaAdjustedTemperature(packetValue, res), res, tempval)); // sensor update is just on change - MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_CMND_SENSOR)); + if (Settings->flag5.tuyasns_no_immediate) { + XdrvRulesProcess(0); + } else { + MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_CMND_SENSOR)); + } } }