mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
codacy/lint warnings
This commit is contained in:
@@ -551,8 +551,6 @@ void publishEMSValues(bool force) {
|
|||||||
StaticJsonDocument<MQTT_MAX_PAYLOAD_SIZE> doc;
|
StaticJsonDocument<MQTT_MAX_PAYLOAD_SIZE> doc;
|
||||||
char data[MQTT_MAX_PAYLOAD_SIZE] = {0};
|
char data[MQTT_MAX_PAYLOAD_SIZE] = {0};
|
||||||
|
|
||||||
static uint8_t last_boilerActive = 0xFF; // for remembering last setting of the tap water or heating on/off
|
|
||||||
|
|
||||||
// do we have boiler changes?
|
// do we have boiler changes?
|
||||||
if (ems_getBoilerEnabled() && (ems_Device_has_flags(EMS_DEVICE_UPDATE_FLAG_BOILER) || force)) {
|
if (ems_getBoilerEnabled() && (ems_Device_has_flags(EMS_DEVICE_UPDATE_FLAG_BOILER) || force)) {
|
||||||
JsonObject rootBoiler = doc.to<JsonObject>();
|
JsonObject rootBoiler = doc.to<JsonObject>();
|
||||||
@@ -657,6 +655,7 @@ void publishEMSValues(bool force) {
|
|||||||
|
|
||||||
// see if the heating or hot tap water has changed, if so send
|
// see if the heating or hot tap water has changed, if so send
|
||||||
// last_boilerActive stores heating in bit 1 and tap water in bit 2
|
// last_boilerActive stores heating in bit 1 and tap water in bit 2
|
||||||
|
static uint8_t last_boilerActive = 0xFF; // for remembering last setting of the tap water or heating on/off
|
||||||
if ((last_boilerActive != ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive)) || force) {
|
if ((last_boilerActive != ((EMS_Boiler.tapwaterActive << 1) + EMS_Boiler.heatingActive)) || force) {
|
||||||
myDebugLog("Publishing hot water and heating states via MQTT");
|
myDebugLog("Publishing hot water and heating states via MQTT");
|
||||||
myESP.mqttPublish(TOPIC_BOILER_TAPWATER_ACTIVE, EMS_Boiler.tapwaterActive == 1 ? "1" : "0");
|
myESP.mqttPublish(TOPIC_BOILER_TAPWATER_ACTIVE, EMS_Boiler.tapwaterActive == 1 ? "1" : "0");
|
||||||
|
|||||||
12
src/ems.cpp
12
src/ems.cpp
@@ -749,14 +749,14 @@ void ems_parseTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
* or either a return code like 0x01 or 0x04 from the last Write command
|
* or either a return code like 0x01 or 0x04 from the last Write command
|
||||||
*/
|
*/
|
||||||
if (length == 1) {
|
if (length == 1) {
|
||||||
uint8_t value = telegram[0]; // 1st byte of data package
|
uint8_t value = telegram[0]; // 1st byte of data package
|
||||||
static uint32_t _last_emsPollFrequency = 0;
|
|
||||||
|
|
||||||
// check first for a Poll for us
|
// check first for a Poll for us
|
||||||
if ((value ^ 0x80 ^ EMS_Sys_Status.emsIDMask) == EMS_ID_ME) {
|
if ((value ^ 0x80 ^ EMS_Sys_Status.emsIDMask) == EMS_ID_ME) {
|
||||||
uint32_t timenow_microsecs = micros();
|
static uint32_t _last_emsPollFrequency = 0;
|
||||||
EMS_Sys_Status.emsPollFrequency = (timenow_microsecs - _last_emsPollFrequency);
|
uint32_t timenow_microsecs = micros();
|
||||||
_last_emsPollFrequency = timenow_microsecs;
|
EMS_Sys_Status.emsPollFrequency = (timenow_microsecs - _last_emsPollFrequency);
|
||||||
|
_last_emsPollFrequency = timenow_microsecs;
|
||||||
|
|
||||||
// do we have something to send thats waiting in the Tx queue?
|
// do we have something to send thats waiting in the Tx queue?
|
||||||
// if so send it if the Queue is not in a wait state
|
// if so send it if the Queue is not in a wait state
|
||||||
@@ -877,7 +877,6 @@ void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
uint8_t length = EMS_RxTelegram->data_length;
|
uint8_t length = EMS_RxTelegram->data_length;
|
||||||
|
|
||||||
char output_str[200] = {0};
|
char output_str[200] = {0};
|
||||||
char buffer[16] = {0};
|
|
||||||
char color_s[20] = {0};
|
char color_s[20] = {0};
|
||||||
char type_s[30];
|
char type_s[30];
|
||||||
|
|
||||||
@@ -899,6 +898,7 @@ void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (length) {
|
if (length) {
|
||||||
|
char buffer[16] = {0};
|
||||||
// type
|
// type
|
||||||
strlcat(output_str, ", type 0x", sizeof(output_str));
|
strlcat(output_str, ", type 0x", sizeof(output_str));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user