From ac52259dc8579d050118f142e00b4a2c71055c35 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 17 May 2021 09:20:45 +0200 Subject: [PATCH] restore USE_SCRIPT_STATUS --- tasmota/support_command.ino | 4 ---- tasmota/xdrv_10_scripter.ino | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 3e26a98d3..971536ef6 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -642,10 +642,6 @@ void CmndStatus(void) } #endif -#ifdef USE_SCRIPT_STATUS - if (bitRead(Settings.rule_enabled, 0)) { Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data); } -#endif - ResponseClear(); } diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 77a40dbb7..b773a264d 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -8410,7 +8410,15 @@ bool Xdrv10(uint8_t function) break; case FUNC_RULES_PROCESS: if (bitRead(Settings.rule_enabled, 0)) { +#ifdef USE_SCRIPT_STATUS + if (!strncmp_P(TasmotaGlobal.mqtt_data, PSTR("{\"Status"), 8)) { + Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data); + } else { + Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); + } +#else Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); +#endif result = glob_script_mem.event_handeled; } break;