From 3e5fe74b38f2f43170c90a3f6dcf1efcf1214ff3 Mon Sep 17 00:00:00 2001 From: lumapu Date: Mon, 28 Aug 2023 16:42:29 +0200 Subject: [PATCH] 0.7.44 * fix `last_success` transmitted to often #1124 * fix github action --- scripts/getVersion.py | 1 + src/CHANGES.md | 3 +++ src/defines.h | 2 +- src/publisher/pubMqttIvData.h | 7 +++++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/getVersion.py b/scripts/getVersion.py index cf739710..b6bef458 100644 --- a/scripts/getVersion.py +++ b/scripts/getVersion.py @@ -51,6 +51,7 @@ def readVersion(path, infile): os.mkdir(path + "firmware/") os.mkdir(path + "firmware/ESP8266/") + os.mkdir(path + "firmware/ESP8285/") os.mkdir(path + "firmware/ESP32/") os.mkdir(path + "firmware/ESP32-S2/") os.mkdir(path + "firmware/ESP32-S3/") diff --git a/src/CHANGES.md b/src/CHANGES.md index d3d7ee53..a16a638e 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,8 @@ # Development Changes +## 0.7.44 - 2023-08-28 +* fix `last_success` transmitted to often #1124 + ## 0.7.43 - 2023-08-28 * improved RSSI for NRF24, now it's read per package (and inverter) #1129 * arranged `heap` related info together in `/system` diff --git a/src/defines.h b/src/defines.h index 758f355e..ca67f8fb 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 7 -#define VERSION_PATCH 43 +#define VERSION_PATCH 44 //------------------------------------- typedef struct { diff --git a/src/publisher/pubMqttIvData.h b/src/publisher/pubMqttIvData.h index 9393733e..8446b4e8 100644 --- a/src/publisher/pubMqttIvData.h +++ b/src/publisher/pubMqttIvData.h @@ -28,7 +28,8 @@ class PubMqttIvData { mState = IDLE; mZeroValues = false; - memset(mIvLastRTRpub, 0, MAX_NUM_INVERTERS * 4); + memset(mIvLastRTRpub, 0, MAX_NUM_INVERTERS * sizeof(uint32_t)); + memset(mIvLastPublish, 0, MAX_NUM_INVERTERS * sizeof(uint32_t)); mRTRDataHasBeenSent = false; mTable[IDLE] = &PubMqttIvData::stateIdle; @@ -102,7 +103,7 @@ class PubMqttIvData { mPos = 0; if(found) { record_t<> *rec = mIv->getRecordStruct(mCmd); - if(mIv->getLastTs(rec) != mIvLastRTRpub[mIv->id]) { + if(mIv->getLastTs(rec) != mIvLastPublish[mIv->id]) { snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/last_success", mIv->config->name); snprintf(mVal, 40, "%d", mIv->getLastTs(rec)); mPublish(mSubTopic, mVal, true, QOS_0); @@ -133,6 +134,7 @@ class PubMqttIvData { pubData &= (lastTs != mIvLastRTRpub[mIv->id]); if (pubData) { + mIvLastPublish[mIv->id] = lastTs; if(mPos < rec->length) { bool retained = false; if (mCmd == RealTimeRunData_Debug) { @@ -239,6 +241,7 @@ class PubMqttIvData { Inverter<> *mIv, *mIvSend; uint8_t mPos; uint32_t mIvLastRTRpub[MAX_NUM_INVERTERS]; + uint32_t mIvLastPublish[MAX_NUM_INVERTERS]; bool mRTRDataHasBeenSent; char mSubTopic[32 + MAX_NAME_LENGTH + 1];