From 58dc18844b450c5a134dfc17730df578ac7394ce Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 30 Oct 2020 12:45:34 +0100 Subject: [PATCH] Refactor energy func every 250mS --- tasmota/xdrv_03_energy.ino | 4 +++- tasmota/xnrg_03_pzem004t.ino | 2 +- tasmota/xnrg_08_sdm120.ino | 2 +- tasmota/xnrg_10_sdm630.ino | 2 +- tasmota/xnrg_11_ddsu666.ino | 2 +- tasmota/xnrg_12_solaxX1.ino | 2 +- tasmota/xnrg_13_fif_le01mr.ino | 4 +--- tasmota/xnrg_15_teleinfo.ino | 2 +- tasmota/xnrg_16_iem3000.ino | 2 +- tasmota/xnrg_17_ornowe517.ino | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tasmota/xdrv_03_energy.ino b/tasmota/xdrv_03_energy.ino index 32a03fa95..4f41fa229 100644 --- a/tasmota/xdrv_03_energy.ino +++ b/tasmota/xdrv_03_energy.ino @@ -1189,7 +1189,9 @@ bool Xdrv03(uint8_t function) XnrgCall(FUNC_LOOP); break; case FUNC_EVERY_250_MSECOND: - XnrgCall(FUNC_EVERY_250_MSECOND); + if (TasmotaGlobal.uptime > 4) { + XnrgCall(FUNC_EVERY_250_MSECOND); + } break; case FUNC_EVERY_SECOND: XnrgCall(FUNC_EVERY_SECOND); diff --git a/tasmota/xnrg_03_pzem004t.ino b/tasmota/xnrg_03_pzem004t.ino index b2f61d033..36b21564c 100644 --- a/tasmota/xnrg_03_pzem004t.ino +++ b/tasmota/xnrg_03_pzem004t.ino @@ -285,7 +285,7 @@ bool Xnrg03(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (PzemSerial && (TasmotaGlobal.uptime > 4)) { PzemEvery250ms(); } + if (PzemSerial) { PzemEvery250ms(); } break; case FUNC_COMMAND: result = PzemCommand(); diff --git a/tasmota/xnrg_08_sdm120.ino b/tasmota/xnrg_08_sdm120.ino index 1683720f6..b21cf12b8 100644 --- a/tasmota/xnrg_08_sdm120.ino +++ b/tasmota/xnrg_08_sdm120.ino @@ -242,7 +242,7 @@ bool Xnrg08(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { SDM120Every250ms(); } + SDM120Every250ms(); break; case FUNC_JSON_APPEND: Sdm220Show(1); diff --git a/tasmota/xnrg_10_sdm630.ino b/tasmota/xnrg_10_sdm630.ino index ef2249600..145898f6f 100644 --- a/tasmota/xnrg_10_sdm630.ino +++ b/tasmota/xnrg_10_sdm630.ino @@ -242,7 +242,7 @@ bool Xnrg10(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { SDM630Every250ms(); } + SDM630Every250ms(); break; case FUNC_INIT: Sdm630SnsInit(); diff --git a/tasmota/xnrg_11_ddsu666.ino b/tasmota/xnrg_11_ddsu666.ino index eefe3270a..8f453e766 100644 --- a/tasmota/xnrg_11_ddsu666.ino +++ b/tasmota/xnrg_11_ddsu666.ino @@ -159,7 +159,7 @@ bool Xnrg11(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { DDSU666Every250ms(); } + DDSU666Every250ms(); break; case FUNC_INIT: Ddsu666SnsInit(); diff --git a/tasmota/xnrg_12_solaxX1.ino b/tasmota/xnrg_12_solaxX1.ino index f80d04a17..be0c99958 100644 --- a/tasmota/xnrg_12_solaxX1.ino +++ b/tasmota/xnrg_12_solaxX1.ino @@ -505,7 +505,7 @@ bool Xnrg12(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { solaxX1250MSecond(); } + solaxX1250MSecond(); break; case FUNC_JSON_APPEND: solaxX1Show(1); diff --git a/tasmota/xnrg_13_fif_le01mr.ino b/tasmota/xnrg_13_fif_le01mr.ino index ab94b6e51..a36e99b62 100644 --- a/tasmota/xnrg_13_fif_le01mr.ino +++ b/tasmota/xnrg_13_fif_le01mr.ino @@ -269,9 +269,7 @@ bool Xnrg13(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { - FifLEEvery250ms(); - } + FifLEEvery250ms(); break; case FUNC_JSON_APPEND: FifLEShow(1); diff --git a/tasmota/xnrg_15_teleinfo.ino b/tasmota/xnrg_15_teleinfo.ino index b8c696a5f..db5f37b1d 100755 --- a/tasmota/xnrg_15_teleinfo.ino +++ b/tasmota/xnrg_15_teleinfo.ino @@ -640,7 +640,7 @@ bool Xnrg15(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { TInfoEvery250ms(); } + TInfoEvery250ms(); break; case FUNC_JSON_APPEND: TInfoShow(1); diff --git a/tasmota/xnrg_16_iem3000.ino b/tasmota/xnrg_16_iem3000.ino index 95c906f09..6cf92ebc4 100644 --- a/tasmota/xnrg_16_iem3000.ino +++ b/tasmota/xnrg_16_iem3000.ino @@ -192,7 +192,7 @@ bool Xnrg16(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { IEM3000Every250ms(); } + IEM3000Every250ms(); break; case FUNC_INIT: Iem3000SnsInit(); diff --git a/tasmota/xnrg_17_ornowe517.ino b/tasmota/xnrg_17_ornowe517.ino index 4e9b50f70..1e1ed928d 100644 --- a/tasmota/xnrg_17_ornowe517.ino +++ b/tasmota/xnrg_17_ornowe517.ino @@ -216,7 +216,7 @@ bool Xnrg17(uint8_t function) switch (function) { case FUNC_EVERY_250_MSECOND: - if (TasmotaGlobal.uptime > 4) { WE517Every250ms(); } + WE517Every250ms(); break; case FUNC_INIT: We517SnsInit();