Skip to content

Commit

Permalink
Merge pull request #3 from arendst/development
Browse files Browse the repository at this point in the history
update local repo
  • Loading branch information
vic42 authored Dec 22, 2020
2 parents b1c6137 + 59992d1 commit 64ba251
Show file tree
Hide file tree
Showing 37 changed files with 274 additions and 50 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- Support for P9813 RGB Led MOSFET controller (#10104)
- Support for GPIO option selection
- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs (#10196)
- Support for FTC532 8-button touch controller by Peter Franck (#10222)

### Fixed
- Redesign syslog and mqttlog using log buffer (#10164)
Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota
- Support for P9813 RGB Led MOSFET controller [#10104](https://github.com/arendst/Tasmota/issues/10104)
- Support for GPIO option selection
- Gpio ``Option_a1`` enabling PWM2 high impedance if powered off as used by Wyze bulbs [#10196](https://github.com/arendst/Tasmota/issues/10196)
- Support for FTC532 8-button touch controller by Peter Franck [#10222](https://github.com/arendst/Tasmota/issues/10222)

### Fixed
- Redesign syslog and mqttlog using log buffer [#10164](https://github.com/arendst/Tasmota/issues/10152)
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/bg_BG.h
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/cs_CZ.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/de_DE.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/el_GR.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/en_GB.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532"
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/es_ES.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/fr_FR.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RF TX"
#define D_SENSOR_RFRECV "RF RX"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/he_HE.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/hu_HU.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/it_IT.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 - STB"
#define D_SENSOR_HX711_SCK "HX711 - SCK"
#define D_SENSOR_HX711_DAT "HX711 - DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RF - TX"
#define D_SENSOR_RFRECV "RF - RX"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ko_KO.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/nl_NL.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pl_PL.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pt_BR.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/pt_PT.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ro_RO.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/ru_RU.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/sk_SK.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/sv_SE.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/tr_TR.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/uk_UA.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFRecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/vi_VN.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/zh_CN.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
1 change: 1 addition & 0 deletions tasmota/language/zh_TW.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@
#define D_SENSOR_TM1638_STB "TM16 STB"
#define D_SENSOR_HX711_SCK "HX711 SCK"
#define D_SENSOR_HX711_DAT "HX711 DAT"
#define D_SENSOR_FTC532 "FTC532""
#define D_SENSOR_TX2X_TX "TX2x"
#define D_SENSOR_RFSEND "RFSend"
#define D_SENSOR_RFRECV "RFrecv"
Expand Down
2 changes: 2 additions & 0 deletions tasmota/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@

//#define USE_WINDMETER // Add support for analog anemometer (+2k2 code)

//#define USE_FTC532 // Add support for FTC532 8-button touch controller (+0k6 code)

//#define USE_RC_SWITCH // Add support for RF transceiver using library RcSwitch (+2k7 code, 460 iram)

//#define USE_RF_SENSOR // Add support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
Expand Down
16 changes: 15 additions & 1 deletion tasmota/support.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1924,9 +1924,11 @@ void Syslog(void)
}
}

void SyslogAsync(void) {
void SyslogAsync(bool refresh) {
static uint32_t index = 1;

if (refresh && !NeedLogRefresh(TasmotaGlobal.syslog_level, index)) { return; }

char* line;
size_t len;
while (GetLog(TasmotaGlobal.syslog_level, &index, &line, &len)) {
Expand All @@ -1940,6 +1942,16 @@ void SyslogAsync(void) {
}
}

bool NeedLogRefresh(uint32_t req_loglevel, uint32_t index) {
// Skip initial buffer fill
if (strlen(TasmotaGlobal.log_buffer) < LOG_BUFFER_SIZE - LOGSZ) { return false; }

char* line;
size_t len;
if (!GetLog(req_loglevel, &index, &line, &len)) { return false; }
return ((line - TasmotaGlobal.log_buffer) < LOG_BUFFER_SIZE / 4);
}

bool GetLog(uint32_t req_loglevel, uint32_t* index_p, char** entry_pp, size_t* len_p) {
uint32_t index = *index_p;

Expand Down Expand Up @@ -1996,6 +2008,8 @@ void AddLog(uint32_t loglevel) {
uint32_t highest_loglevel = Settings.weblog_level;
if (Settings.mqttlog_level > highest_loglevel) { highest_loglevel = Settings.mqttlog_level; }
if (TasmotaGlobal.syslog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.syslog_level; }
if (TasmotaGlobal.templog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.templog_level; }

if ((loglevel <= highest_loglevel) && // Log only when needed
(TasmotaGlobal.masterlog_level <= highest_loglevel)) {
// Delimited, zero-terminated buffer of log lines.
Expand Down
4 changes: 3 additions & 1 deletion tasmota/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ void ResponseAppendFeatures(void)
#ifdef USE_RC522
feature7 |= 0x00002000; // xsns_80_mfrc522.ino
#endif
// feature7 |= 0x00004000;
#ifdef USE_FTC532
feature7 |= 0x00004000; // xdrv_47_ftc532.ino
#endif
// feature7 |= 0x00008000;

// feature7 |= 0x00010000;
Expand Down
8 changes: 6 additions & 2 deletions tasmota/support_tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ void PerformEverySecond(void)
}
}

MqttPublishLoggingAsync();
SyslogAsync();
MqttPublishLoggingAsync(false);
SyslogAsync(false);

ResetGlobalValues();

Expand Down Expand Up @@ -984,6 +984,10 @@ void Every250mSeconds(void)
SetLedPower(tstate);
}

// Check if log refresh needed in case of fast buffer fill
MqttPublishLoggingAsync(true);
SyslogAsync(true);

/*-------------------------------------------------------------------------------------------*\
* Every second at 0.25 second interval
\*-------------------------------------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion tasmota/tasmota.ino
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct {
uint8_t masterlog_level; // Master log level used to override set log level
uint8_t seriallog_level; // Current copy of Settings.seriallog_level
uint8_t syslog_level; // Current copy of Settings.syslog_level
uint8_t templog_level; // Temporary log level to be used by HTTP cm and Telegram
uint8_t module_type; // Current copy of Settings.module or user template type
uint8_t last_source; // Last command source
uint8_t shutters_present; // Number of actual define shutters
Expand Down Expand Up @@ -197,7 +198,6 @@ void setup(void) {
memset(&TasmotaGlobal, 0, sizeof(TasmotaGlobal));
TasmotaGlobal.baudrate = APP_BAUDRATE;
TasmotaGlobal.seriallog_timer = SERIALLOG_TIMER;
TasmotaGlobal.gpio_optiona.data = 0;
TasmotaGlobal.temperature_celsius = NAN;
TasmotaGlobal.blinks = 201;
TasmotaGlobal.wifi_state_flag = WIFI_RESTART;
Expand Down
5 changes: 5 additions & 0 deletions tasmota/tasmota_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ enum UserSelectablePins {
GPIO_RC522_RST, // RC522 reset
GPIO_P9813_CLK, GPIO_P9813_DAT, // P9813 Clock and Data
GPIO_OPTION_A, // Specific device options to be served in code
GPIO_FTC532, // FTC532 touch ctrlr serial input
GPIO_SENSOR_END };

enum ProgramSelectablePins {
Expand Down Expand Up @@ -282,6 +283,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_RC522_RST "|"
D_SENSOR_P9813_CLK "|" D_SENSOR_P9813_DAT "|"
D_SENSOR_OPTION "_a|"
D_SENSOR_FTC532
;

const char kSensorNamesFixed[] PROGMEM =
Expand Down Expand Up @@ -325,6 +327,9 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_LEDLNK_INV), // Inverted link led
AGPIO(GPIO_OUTPUT_HI), // Fixed output high
AGPIO(GPIO_OUTPUT_LO), // Fixed output low
#ifdef USE_FTC532
AGPIO(GPIO_FTC532), // FTC532 touch input
#endif

/*-------------------------------------------------------------------------------------------*\
* Protocol specifics
Expand Down
40 changes: 19 additions & 21 deletions tasmota/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3017,32 +3017,30 @@ void HandleHttpCommand(void)
}

WSContentBegin(200, CT_JSON);
uint32_t curridx = TasmotaGlobal.log_buffer_pointer;
String svalue = Webserver->arg("cmnd");
if (svalue.length() && (svalue.length() < MQTT_MAX_PACKET_SIZE)) {
uint32_t curridx = TasmotaGlobal.log_buffer_pointer;
TasmotaGlobal.templog_level = LOG_LEVEL_INFO;
ExecuteWebCommand((char*)svalue.c_str(), SRC_WEBCOMMAND);
if (TasmotaGlobal.log_buffer_pointer != curridx) {
WSContentSend_P(PSTR("{"));
bool cflg = false;
uint32_t index = curridx;
char* line;
size_t len;
while (GetLog(Settings.weblog_level, &index, &line, &len)) {
// [14:49:36.123 MQTT: stat/wemos5/RESULT = {"POWER":"OFF"}] > [{"POWER":"OFF"}]
char* JSON = (char*)memchr(line, '{', len);
if (JSON) { // Is it a JSON message (and not only [15:26:08 MQT: stat/wemos5/POWER = O])
size_t JSONlen = len - (JSON - line);
if (JSONlen > sizeof(TasmotaGlobal.mqtt_data)) { JSONlen = sizeof(TasmotaGlobal.mqtt_data); }
char stemp[JSONlen];
strlcpy(stemp, JSON +1, JSONlen -2);
WSContentSend_P(PSTR("%s%s"), (cflg) ? "," : "", stemp);
cflg = true;
}
WSContentSend_P(PSTR("{"));
bool cflg = false;
uint32_t index = curridx;
char* line;
size_t len;
while (GetLog(TasmotaGlobal.templog_level, &index, &line, &len)) {
// [14:49:36.123 MQTT: stat/wemos5/RESULT = {"POWER":"OFF"}] > [{"POWER":"OFF"}]
char* JSON = (char*)memchr(line, '{', len);
if (JSON) { // Is it a JSON message (and not only [15:26:08 MQT: stat/wemos5/POWER = O])
size_t JSONlen = len - (JSON - line);
if (JSONlen > sizeof(TasmotaGlobal.mqtt_data)) { JSONlen = sizeof(TasmotaGlobal.mqtt_data); }
char stemp[JSONlen];
strlcpy(stemp, JSON +1, JSONlen -2);
WSContentSend_P(PSTR("%s%s"), (cflg) ? "," : "", stemp);
cflg = true;
}
WSContentSend_P(PSTR("}"));
} else {
WSContentSend_P(PSTR("{\"" D_RSLT_WARNING "\":\"" D_ENABLE_WEBLOG_FOR_RESPONSE "\"}"));
}
WSContentSend_P(PSTR("}"));
TasmotaGlobal.templog_level = 0;
} else {
WSContentSend_P(PSTR("{\"" D_RSLT_WARNING "\":\"" D_ENTER_COMMAND " cmnd=\"}"));
}
Expand Down
3 changes: 2 additions & 1 deletion tasmota/xdrv_02_mqtt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ void MqttUnsubscribe(const char *topic)
MqttUnsubscribeLib(topic);
}

void MqttPublishLoggingAsync(void) {
void MqttPublishLoggingAsync(bool refresh) {
static uint32_t index = 1;

if (!Settings.flag.mqtt_enabled) { return; } // SetOption3 - Enable MQTT
if (refresh && !NeedLogRefresh(Settings.mqttlog_level, index)) { return; }

char* line;
size_t len;
Expand Down
Loading

0 comments on commit 64ba251

Please sign in to comment.