Skip to content

Commit cbdb150

Browse files
committed
0.7.26 release
fix MqTT `last_success`
1 parent bab700c commit cbdb150

File tree

4 files changed

+10
-27
lines changed

4 files changed

+10
-27
lines changed

src/CHANGES.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
Changelog v0.7.25
1+
Changelog v0.7.26
22

3-
* ✨ added 'HMS' and 'HMT' support with 'CMT2300A' radio module and `ESP32`
4-
* improved MqTT
5-
* added more display types
6-
* changed maximum number of inverters: ESP32: `16`, ESP8266: `4`
7-
* added option to connect to hidden SSID WiFi
8-
* AP password is configurable now
9-
* add option to communicate with inverters even if no time sync is possible
10-
* add option to reboot Ahoy perodically at midnight
11-
* add time, date and Ahoy-Version number to JSON export
12-
* changed date-time format to ISO format in web UI
13-
* added inverter state machine to archive better its state
14-
* added for NTP sync more info to web UI about the sync itself
15-
* increased to latest library versions (MqTT, RF24 and JSON)
16-
* minor UI improvements
17-
* several bug fixes
3+
* fix MqTT `last_success`

src/defines.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//-------------------------------------
1414
#define VERSION_MAJOR 0
1515
#define VERSION_MINOR 7
16-
#define VERSION_PATCH 25
16+
#define VERSION_PATCH 26
1717

1818
//-------------------------------------
1919
typedef struct {

src/publisher/pubMqtt.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -465,13 +465,12 @@ class PubMqtt {
465465
return (pos >= DEVICE_CLS_ASSIGN_LIST_LEN) ? NULL : stateClasses[deviceFieldAssignment[pos].stateClsId];
466466
}
467467

468-
bool processIvStatus() {
468+
bool processIvStatus() {
469469
// returns true if any inverter is available
470470
bool allAvail = true; // shows if all enabled inverters are available
471471
bool anyAvail = false; // shows if at least one enabled inverter is available
472472
bool changed = false;
473473
Inverter<> *iv;
474-
record_t<> *rec;
475474

476475
for (uint8_t id = 0; id < mSys->getNumInverters(); id++) {
477476
iv = mSys->getInverterByPos(id);
@@ -480,17 +479,10 @@ class PubMqtt {
480479
if (!iv->config->enabled)
481480
continue; // skip to next inverter
482481

483-
rec = iv->getRecordStruct(RealTimeRunData_Debug);
484-
485482
// inverter status
486483
iv->isProducing(); // recalculate status
487-
if (InverterStatus::OFF < iv->status) {
484+
if (InverterStatus::OFF < iv->status)
488485
anyAvail = true;
489-
490-
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/last_success", iv->config->name);
491-
snprintf(mVal, 40, "%d", iv->getLastTs(rec));
492-
publish(mSubTopic, mVal, true);
493-
}
494486
else // inverter is enabled but not available
495487
allAvail = false;
496488

src/publisher/pubMqttIvData.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ class PubMqttIvData {
101101

102102
mPos = 0;
103103
if(found) {
104+
record_t<> *rec = mIv->getRecordStruct(mCmd);
105+
snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/last_success", mIv->config->name);
106+
snprintf(mVal, 40, "%d", mIv->getLastTs(rec));
107+
mPublish(mSubTopic, mVal, true);
108+
104109
mIv->isProducing(); // recalculate status
105110
mState = SEND_DATA;
106111
} else if(mSendTotals && mTotalFound)

0 commit comments

Comments
 (0)