renamed previousSMPublishCRC

This commit is contained in:
Paul
2019-07-02 22:46:24 +02:00
parent 21ae6ebc0d
commit 18cb01b57f

View File

@@ -177,7 +177,6 @@ char * _bool_to_char(char * s, uint8_t value) {
// decimals: 0 = no division, 1=divide value by 10, 2=divide by 2, 10=divide value by 100
// negative values are assumed stored as 1-compliment (https://medium.com/@LeeJulija/how-integers-are-stored-in-memory-using-twos-complement-5ba04d61a56c)
char * _short_to_char(char * s, int16_t value, uint8_t decimals = 1) {
// remove errors or invalid values
if (value == EMS_VALUE_SHORT_NOTSET) {
strlcpy(s, "?", 10);
@@ -608,7 +607,7 @@ void publishValues(bool force) {
static uint8_t last_boilerActive = 0xFF; // for remembering last setting of the tap water or heating on/off
static uint32_t previousBoilerPublishCRC = 0; // CRC check for boiler values
static uint32_t previousThermostatPublishCRC = 0; // CRC check for thermostat values
static uint32_t previousOtherPublishCRC = 0; // CRC check for other values (e.g. SM10)
static uint32_t previousSMPublishCRC = 0; // CRC check for Solar Module values (e.g. SM10)
JsonObject rootBoiler = doc.to<JsonObject>();
@@ -814,8 +813,8 @@ void publishValues(bool force) {
crc.update(data[i]);
}
fchecksum = crc.finalize();
if ((previousOtherPublishCRC != fchecksum) || force) {
previousOtherPublishCRC = fchecksum;
if ((previousSMPublishCRC != fchecksum) || force) {
previousSMPublishCRC = fchecksum;
myDebugLog("Publishing SM data via MQTT");
// send values via MQTT