* fix MqTT total values #1326
This commit is contained in:
lumapu 2024-01-05 17:19:53 +01:00
parent b4ba35e6ab
commit 617cf0a92a
3 changed files with 42 additions and 38 deletions

View file

@ -1,8 +1,11 @@
# Development Changes
## 0.8.45 - 2024-01-05
* fix MqTT total values #1326
## 0.8.44 - 2024-01-05
* fix MqTT transmission of data #1326
* live data is read much earlier / faster and more often
* live data is read much earlier / faster and more often #1272
## 0.8.43 - 2024-01-04
* fix display of sunrise in `/system` #1308

View file

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 44
#define VERSION_PATCH 45
//-------------------------------------
typedef struct {

View file

@ -133,7 +133,6 @@ class PubMqttIvData {
return;
}
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
if(mPos < rec->length) {
bool retained = false;
if (mCmd == RealTimeRunData_Debug) {
@ -170,18 +169,20 @@ class PubMqttIvData {
}
}
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
uint8_t qos = (FLD_ACT_ACTIVE_PWR_LIMIT == rec->assign[mPos].fieldId) ? QOS_2 : QOS_0;
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/ch%d/%s", mIv->config->name, rec->assign[mPos].ch, fields[rec->assign[mPos].fieldId]);
snprintf(mVal, 40, "%g", ah::round3(mIv->getValue(mPos, rec)));
mPublish(mSubTopic, mVal, retained, qos);
}
mPos++;
} else {
if (MqttSentStatus::LAST_SUCCESS_SENT == rec->mqttSentStatus) {
sendRadioStat(rec->length);
rec->mqttSentStatus = MqttSentStatus::DATA_SENT;
}
mState = FIND_NXT_IV;
}
} else
mState = FIND_NXT_IV;
}
inline void sendRadioStat(uint8_t start) {