From d84b5fdfd894ffe3cd0a2e3b87ac0c4ea38def13 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 21 Feb 2021 14:17:51 +0100 Subject: [PATCH 01/12] Fix web request accepts wrong password Fix web request accepts wrong password (#11039) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tasmota/xdrv_01_webserver.ino | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f565c2f0cb71..bec272b29044 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file. - Shutter driver (#11055) - ESP32 Mi32 driver (#11048) - TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable (#11057) +- Web request accepts wrong password (#11039) ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 97b9f1316b96..8f8ac126a97a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -88,3 +88,4 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - Shutter driver [#11055](https://github.com/arendst/Tasmota/issues/11055) - ESP32 Mi32 driver [#11048](https://github.com/arendst/Tasmota/issues/11048) - TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable [#11057](https://github.com/arendst/Tasmota/issues/11057) +- Web request accepts wrong password [#11039](https://github.com/arendst/Tasmota/issues/11039) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index de6eb9abcfe3..4ded970b9e13 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -2676,7 +2676,7 @@ void HandleHttpCommand(void) // Prefer authorization via HTTP header (Basic auth), if it fails, use legacy method via GET parameters char tmp1[33]; WebGetArg(PSTR("user"), tmp1, sizeof(tmp1)); - char tmp2[strlen(SettingsText(SET_WEBPWD)) + 1]; + char tmp2[strlen(SettingsText(SET_WEBPWD)) + 2]; // Need space for an entered password longer than set password WebGetArg(PSTR("password"), tmp2, sizeof(tmp2)); if (!(!strcmp(tmp1, WEB_USERNAME) && !strcmp(tmp2, SettingsText(SET_WEBPWD)))) { From b2e1258e22ddc2411a3bcd8dbf204bc49a445c1c Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 21 Feb 2021 14:33:51 +0100 Subject: [PATCH 02/12] Fix TM1637 display init Fix TM1637 display init (#11057) --- tasmota/xdsp_15_tm1637.ino | 49 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index 7ea7c0ea1913..82f6c32a51ae 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -144,7 +144,7 @@ #define SCROLL_MAX_LEN 50 #include "SevenSegmentTM1637.h" -SevenSegmentTM1637 *display; +SevenSegmentTM1637 *tm1637display; struct { char scroll_text[CMD_MAX_LEN]; @@ -166,21 +166,20 @@ struct { \*********************************************************************************************/ void TM1637Init(void) { if (PinUsed(GPIO_TM1637CLK) && PinUsed(GPIO_TM1637DIO)) { - display = new SevenSegmentTM1637(Pin(GPIO_TM1637CLK), Pin(GPIO_TM1637DIO) ); - if (display) { + tm1637display = new SevenSegmentTM1637(Pin(GPIO_TM1637CLK), Pin(GPIO_TM1637DIO)); + if (tm1637display) { Settings.display_model = XDSP_15; TM1637Data.num_digits = Settings.display_size > 3 ? Settings.display_size : 4; Settings.display_size = TM1637Data.num_digits; - display->begin(TM1637Data.num_digits, 1); - display->setBacklight(TM1637Data.brightness * 10); + tm1637display->begin(TM1637Data.num_digits, 1); + tm1637display->setBacklight(TM1637Data.brightness * 10); TM1637ClearDisplay(); AddLog(LOG_LEVEL_INFO, PSTR("DSP: TM1637")); } } } - /*********************************************************************************************\ * Displays number without decimal, with/without leading zeros, specifying start-position * and length, optionally skipping clearing display before displaying the number. @@ -229,17 +228,17 @@ bool CmndTM1637Number(bool clear) { char pad = (leadingzeros ? '0': ' '); uint32_t i = position; uint8_t rawBytes[1]; - rawBytes[0] = display->encode(pad); + rawBytes[0] = tm1637display->encode(pad); for(; iTM1637Data.num_digits) break; - display->printRaw(rawBytes, 1, i); + tm1637display->printRaw(rawBytes, 1, i); } for(uint32_t j = 0; i< position + length; i++, j++) { if(txt[j] == 0) break; - rawBytes[0] = display->encode(txt[j]); + rawBytes[0] = tm1637display->encode(txt[j]); if(i>TM1637Data.num_digits) break; - display->printRaw(rawBytes, 1, i); + tm1637display->printRaw(rawBytes, 1, i); } return true; @@ -296,14 +295,14 @@ bool CmndTM1637Float(bool clear) { uint8_t rawBytes[1]; for(uint32_t i=0, j=0; iencode(txt[i]); + rawBytes[0] = tm1637display->encode(txt[i]); if(txt[i+1] == '.') { rawBytes[0] = rawBytes[0] | 128; i++; length++; } if((j+position) > TM1637Data.num_digits) break; - display->printRaw(rawBytes, 1, j+position); + tm1637display->printRaw(rawBytes, 1, j+position); } return true; @@ -325,7 +324,7 @@ bool CmndTM1637Clear(void) { void TM1637ClearDisplay (void) { unsigned char arr[] = {0}; AddLog(LOG_LEVEL_DEBUG, PSTR("Clearing digit %d"), TM1637Data.num_digits); - for(int i=0; iprintRaw(arr, 1, i); + for(int i=0; iprintRaw(arr, 1, i); } @@ -386,8 +385,8 @@ void TM1637ScrollText(void) { if(i > (TM1637Data.num_digits-1)) break; if(TM1637Data.scroll_text[j] == 0) {clr = true;}; char charToDisp = (clr ? ' ' : TM1637Data.scroll_text[j]); - rawBytes[0] = display->encode(charToDisp); - display->printRaw(rawBytes, 1, i); + rawBytes[0] = tm1637display->encode(charToDisp); + tm1637display->printRaw(rawBytes, 1, i); } TM1637Data.scroll_index++; } @@ -424,7 +423,7 @@ bool CmndTM1637Level(void) { uint8_t value = (((i%2) == 0) ? 54 : 48); AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: CmndTM1637Level value %d"), value); rawBytes[0] = value; - display->printRaw(rawBytes, 1, digit); + tm1637display->printRaw(rawBytes, 1, digit); } return true; } @@ -494,7 +493,7 @@ bool CmndTM1637Raw(void) { for(uint32_t i=position; i(TM1637Data.num_digits-1)) break; rawBytes[0] = DATA[i-position]; - display->printRaw(rawBytes, 1, i); + tm1637display->printRaw(rawBytes, 1, i); } return true; @@ -540,14 +539,14 @@ bool CmndTM1637Text(bool clear) { for(uint32_t j = 0; i< position + length; i++, j++) { if(i > (TM1637Data.num_digits-1)) break; if(sString[j] == 0) break; - rawBytes[0] = display->encode(sString[j]); + rawBytes[0] = tm1637display->encode(sString[j]); if(sString[j+1] == '.') { rawBytes[0] = rawBytes[0] | 128; j++; } else if(sString[j] == '^') { rawBytes[0] = 1 | 2 | 32 | 64; } - display->printRaw(rawBytes, 1, i); + tm1637display->printRaw(rawBytes, 1, i); } return true; @@ -573,7 +572,7 @@ bool CmndTM1637Brightness(void) { } TM1637Data.brightness = val; - display->setBacklight(TM1637Data.brightness*10); + tm1637display->setBacklight(TM1637Data.brightness*10); return true; } @@ -629,9 +628,9 @@ void TM1637ShowTime() { } uint8_t rawBytes[1]; for(uint32_t i = 0; i< 4; i++) { - rawBytes[0] = display->encode(tm[i]); + rawBytes[0] = tm1637display->encode(tm[i]); if((millis() % 1000) > 500 && (i == 1)) rawBytes[0] = rawBytes[0] | 128; - display->printRaw(rawBytes, 1, i); + tm1637display->printRaw(rawBytes, 1, i); } } @@ -643,9 +642,9 @@ bool TM1637Cmd(uint8_t fn) { TM1637Data.num_digits = Settings.display_size; if(TM1637Data.prev_num_digits != TM1637Data.num_digits) { // Cleck for change of display size, and re-init the library AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: Size changed. Re-initializing library...")); - display = new SevenSegmentTM1637(Pin(GPIO_SSPI_SCLK), Pin(GPIO_SSPI_MOSI) ); - display->begin(TM1637Data.num_digits, 1); - display->setBacklight(40); + tm1637display = new SevenSegmentTM1637(Pin(GPIO_TM1637CLK), Pin(GPIO_TM1637DIO)); + tm1637display->begin(TM1637Data.num_digits, 1); + tm1637display->setBacklight(40); TM1637ClearDisplay(); TM1637Data.prev_num_digits = TM1637Data.num_digits; AddLog(LOG_LEVEL_DEBUG, PSTR("TM7: Re-initialized library")); From c8e13366c66deef677cabc5878bee123d7e73da0 Mon Sep 17 00:00:00 2001 From: David Friedland Date: Sun, 21 Feb 2021 10:07:38 -0800 Subject: [PATCH 03/12] animate PWM dimmer brightness LEDs during transitions and with variable brightness --- tasmota/xdrv_04_light.ino | 10 ++++------ tasmota/xdrv_35_pwm_dimmer.ino | 5 +++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index f60a6bdbd4b8..1d78df359873 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -505,9 +505,6 @@ class LightStateClass { uint8_t prev_bri = _briRGB; _briRGB = bri_rgb; if (bri_rgb > 0) { addRGBMode(); } -#ifdef USE_PWM_DIMMER - if (PWM_DIMMER == TasmotaGlobal.module_type) PWMDimmerSetBrightnessLeds(-1); -#endif // USE_PWM_DIMMER return prev_bri; } @@ -516,9 +513,6 @@ class LightStateClass { uint8_t prev_bri = _briCT; _briCT = bri_ct; if (bri_ct > 0) { addCTMode(); } -#ifdef USE_PWM_DIMMER - if (PWM_DIMMER == TasmotaGlobal.module_type) PWMDimmerSetBrightnessLeds(-1); -#endif // USE_PWM_DIMMER return prev_bri; } @@ -1958,6 +1952,10 @@ void LightSetOutputs(const uint16_t *cur_col_10) { if (!Settings.flag4.zerocross_dimmer) { analogWrite(Pin(GPIO_PWM1, i), bitRead(TasmotaGlobal.pwm_inverted, i) ? Settings.pwm_range - cur_col : cur_col); } +#ifdef USE_PWM_DIMMER + // Animate brightness LEDs to follow PWM dimmer brightness + if (PWM_DIMMER == TasmotaGlobal.module_type) PWMDimmerSetBrightnessLeds(change10to8(cur_col)); +#endif // USE_PWM_DIMMER } } } diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index d86082f193ae..555ec1a67ed6 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -167,6 +167,7 @@ void PWMDimmerSetBrightnessLeds(int32_t bri) uint32_t level = 0; led = -1; mask = 0; + uint16_t pwm_led_bri = 0; for (uint32_t count = 0; count < leds; count++) { level += step; for (;;) { @@ -175,7 +176,8 @@ void PWMDimmerSetBrightnessLeds(int32_t bri) if (!mask) mask = 1; if (Settings.ledmask & mask) break; } - SetLedPowerIdx(led, bri >= level); + pwm_led_bri = changeUIntScale((bri > level ? bri - level : 0), 0, step, 0, Settings.pwm_range); + analogWrite(Pin(GPIO_LED1, led), bitRead(TasmotaGlobal.led_inverted, led) ? Settings.pwm_range - pwm_led_bri : pwm_led_bri); } } } @@ -193,7 +195,6 @@ void PWMDimmerSetPoweredOffLed(void) void PWMDimmerSetPower(void) { DigitalWrite(GPIO_REL1, 0, bitRead(TasmotaGlobal.rel_inverted, 0) ? !TasmotaGlobal.power : TasmotaGlobal.power); - PWMDimmerSetBrightnessLeds(-1); PWMDimmerSetPoweredOffLed(); } From de90b8f12dce79435e35ac8761b7117b2c6500b1 Mon Sep 17 00:00:00 2001 From: nagyrobi Date: Sun, 21 Feb 2021 22:41:20 +0100 Subject: [PATCH 04/12] Update en_GB.h Fix propercase and typo --- tasmota/language/en_GB.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 0d0f0b3c9367..081e3c2ae2d5 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -876,7 +876,7 @@ #define D_SOLAX_ERROR_8 "Other Device Fault" //xdrv_10_scripter.ino -#define D_CONFIGURE_SCRIPT "Edit script" +#define D_CONFIGURE_SCRIPT "Edit Script" #define D_SCRIPT "edit script" #define D_SDCARD_UPLOAD "file upload" #define D_UFSDIR "ufs directory" @@ -884,7 +884,7 @@ #define D_SCRIPT_CHARS_LEFT "chars left" #define D_SCRIPT_CHARS_NO_MORE "no more chars" #define D_SCRIPT_DOWNLOAD "Download" -#define D_SCRIPT_ENABLE "script enable" +#define D_SCRIPT_ENABLE "Script enabled" #define D_SCRIPT_UPLOAD "Upload" #define D_SCRIPT_UPLOAD_FILES "Upload files" From ed7c06a6edbe53d391338ce3f50d591575d5b94a Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 22 Feb 2021 11:10:49 +0100 Subject: [PATCH 05/12] sml several fixes --- tasmota/xdrv_10_scripter.ino | 13 +- tasmota/xsns_53_sml.ino | 228 ++++++++++++++++++++++------------- 2 files changed, 153 insertions(+), 88 deletions(-) diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 40f453f9a1b0..05fb79050bac 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -162,6 +162,7 @@ void Script_ticker4_end(void) { #endif #endif +extern uint8_t sml_json_enable; #if defined(EEP_SCRIPT_SIZE) && !defined(ESP32) @@ -208,7 +209,7 @@ void alt_eeprom_readBytes(uint32_t adr, uint32_t len, uint8_t *buf) { #define EPOCH_OFFSET 1546300800 enum {OPER_EQU=1,OPER_PLS,OPER_MIN,OPER_MUL,OPER_DIV,OPER_PLSEQU,OPER_MINEQU,OPER_MULEQU,OPER_DIVEQU,OPER_EQUEQU,OPER_NOTEQU,OPER_GRTEQU,OPER_LOWEQU,OPER_GRT,OPER_LOW,OPER_PERC,OPER_XOR,OPER_AND,OPER_OR,OPER_ANDEQU,OPER_OREQU,OPER_XOREQU,OPER_PERCEQU}; -enum {SCRIPT_LOGLEVEL=1,SCRIPT_TELEPERIOD,SCRIPT_EVENT_HANDLED}; +enum {SCRIPT_LOGLEVEL=1,SCRIPT_TELEPERIOD,SCRIPT_EVENT_HANDLED,SML_JSON_ENABLE}; #ifdef USE_UFILESYS @@ -2985,6 +2986,11 @@ chknext: len = 0; goto exit; } + if (!strncmp(vname, "smlj", 4)) { + fvar = sml_json_enable; + tind->index = SML_JSON_ENABLE; + goto exit_settable; + } #endif //USE_SML_M break; case 't': @@ -4527,6 +4533,11 @@ int16_t Run_script_sub(const char *type, int8_t tlen, struct GVARS *gv) { case SCRIPT_EVENT_HANDLED: glob_script_mem.event_handeled = *dfvar; break; +#if defined(USE_SML_M) && defined (USE_SML_SCRIPT_CMD) + case SML_JSON_ENABLE: + sml_json_enable = *dfvar; + break; +#endif } sysv_type = 0; } diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index e7d291a98286..8816e0fac58c 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -49,8 +49,9 @@ #define SPECIAL_SS #endif -#undef TMSBSIZ +#ifndef TMSBSIZ #define TMSBSIZ 256 +#endif // addresses a bug in meter DWS74 //#define DWS74_BUG @@ -469,7 +470,7 @@ uint8_t dvalid[SML_MAX_VARS]; struct METER_DESC const *meter_desc_p; const uint8_t *meter_p; -uint8_t meter_spos[MAX_METERS]; +uint16_t meter_spos[MAX_METERS]; // software serial pointers #ifdef ESP8266 @@ -820,13 +821,12 @@ uint8_t Serial_peek() { } uint8_t sml_logindex; +char log_data[128]; void Dump2log(void) { - int16_t index=0,hcnt=0; uint32_t d_lastms; uint8_t dchars[16]; - char log_data[128]; //if (!SML_SAVAILABLE) return; @@ -1258,7 +1258,7 @@ void sml_shift_in(uint32_t meters,uint32_t shard) { // QQ,ZZ,PB,SB,NN ..... CRC, ACK SYNC if (meter_spos[meters]>4+5) { // get telegramm lenght - uint8_t tlen=smltbuf[meters][4]+5; + uint16_t tlen=smltbuf[meters][4]+5; // test crc if (smltbuf[meters][tlen]=ebus_CalculateCRC(smltbuf[meters],tlen)) { ebus_esc(smltbuf[meters],tlen); @@ -1548,15 +1548,17 @@ void SML_Decode(uint8_t index) { #endif if (*mp == '#') { // get string value + getstr: mp++; if (meter_desc_p[mindex].type == 'o') { - for (uint8_t p=0; p> %s"),mp); // get scaling factor double fac=CharToDouble((char*)mp); meter_vars[vindex]/=fac; SML_Immediate_MQTT((const char*)mp,vindex,mindex); } + dvalid[vindex] = 1; } } nextsect: @@ -1737,10 +1754,20 @@ void SML_Show(boolean json) { cp=strchr(mp,'@'); if (cp) { cp++; + tststr: if (*cp=='#') { // meter id sprintf(tpowstr,"\"%s\"",&meter_id[mindex][0]); mid=1; + } else if (*cp=='(') { + if (meter_desc_p[mindex].type=='o') { + cp++; + strtol((char*)cp,(char**)&cp, 10); + cp++; + goto tststr; + } else { + mid=0; + } } else { mid=0; } @@ -1987,154 +2014,181 @@ void SML_Init(void) { if (meter_script==99) { // use script definition if (script_meter) free(script_meter); - script_meter=0; - uint8_t *tp=0; - uint16_t index=0; - uint8_t section=0; - uint8_t srcpin=0; - char *lp=glob_script_mem.scriptptr; - sml_send_blocks=0; + script_meter = 0; + uint8_t *tp = 0; + uint16_t index = 0; + uint8_t section = 0; + uint8_t srcpin = 0; + uint8_t dec_line = 0; + char *lp = glob_script_mem.scriptptr; + sml_send_blocks = 0; while (lp) { if (!section) { - if (*lp=='>' && *(lp+1)=='M') { - lp+=2; - meters_used=strtol(lp,0,10); - section=1; - uint32_t mlen=SML_getscriptsize(lp); - if (mlen==0) return; // missing end # - script_meter=(uint8_t*)calloc(mlen,1); + if (*lp == '>' && *(lp+1) == 'M') { + lp += 2; + meters_used = strtol(lp, 0, 10); + section = 1; + uint32_t mlen = SML_getscriptsize(lp); + if (mlen == 0) return; // missing end # + script_meter = (uint8_t*)calloc(mlen, 1); if (!script_meter) { goto dddef_exit; } - tp=script_meter; + tp = script_meter; goto next_line; } } else { - if (!*lp || *lp=='#' || *lp=='>') { - if (*(tp-1)=='|') *(tp-1)=0; + if (!*lp || *lp == '#' || *lp == '>') { + if (*(tp-1) == '|') *(tp-1) = 0; break; } - if (*lp=='+') { + if (*lp == '+') { // add descriptor +1,1,c,0,10,H20 //toLogEOL(">>",lp); lp++; - index=*lp&7; - lp+=2; - if (index<1 || index>meters_used) goto next_line; + index = *lp&7; + lp += 2; + if (index < 1 || index > meters_used) { + AddLog(LOG_LEVEL_INFO, PSTR("illegal meter number!")); + goto next_line; + } index--; - srcpin=strtol(lp,&lp,10); + srcpin = strtol(lp,&lp,10); if (Gpio_used(srcpin)) { AddLog(LOG_LEVEL_INFO, PSTR("gpio rx double define!")); dddef_exit: if (script_meter) free(script_meter); - script_meter=0; - meters_used=METERS_USED; + script_meter = 0; + meters_used = METERS_USED; goto init10; } - script_meter_desc[index].srcpin=srcpin; - if (*lp!=',') goto next_line; + script_meter_desc[index].srcpin = srcpin; + if (*lp != ',') goto next_line; lp++; - script_meter_desc[index].type=*lp; + script_meter_desc[index].type = *lp; lp++; - if (*lp!=',') { - script_meter_desc[index].sopt=*lp&7; + if (*lp != ',') { + script_meter_desc[index].sopt = *lp&7; lp++; } else { - script_meter_desc[index].sopt=0; + script_meter_desc[index].sopt = 0; } lp++; - script_meter_desc[index].flag=strtol(lp,&lp,10); - if (*lp!=',') goto next_line; + script_meter_desc[index].flag = strtol(lp, &lp, 10); + if (*lp != ',') goto next_line; lp++; - script_meter_desc[index].params=strtol(lp,&lp,10); - if (*lp!=',') goto next_line; + script_meter_desc[index].params = strtol(lp, &lp, 10); + if (*lp != ',') goto next_line; lp++; - script_meter_desc[index].prefix[7]=0; - for (uint32_t cnt=0; cnt<8; cnt++) { - if (*lp==SCRIPT_EOL || *lp==',') { - script_meter_desc[index].prefix[cnt]=0; + script_meter_desc[index].prefix[7] = 0; + for (uint32_t cnt = 0; cnt < 8; cnt++) { + if (*lp == SCRIPT_EOL || *lp == ',') { + script_meter_desc[index].prefix[cnt] = 0; break; } - script_meter_desc[index].prefix[cnt]=*lp++; + script_meter_desc[index].prefix[cnt] = *lp++; } - if (*lp==',') { + if (*lp == ',') { lp++; - script_meter_desc[index].trxpin=strtol(lp,&lp,10); + script_meter_desc[index].trxpin = strtol(lp, &lp, 10); if (Gpio_used(script_meter_desc[index].trxpin)) { AddLog(LOG_LEVEL_INFO, PSTR("gpio tx double define!")); goto dddef_exit; } - if (*lp!=',') goto next_line; + if (*lp != ',') goto next_line; lp++; - script_meter_desc[index].tsecs=strtol(lp,&lp,10); - if (*lp==',') { + script_meter_desc[index].tsecs = strtol(lp, &lp, 10); + if (*lp == ',') { lp++; char txbuff[256]; - uint32_t txlen=0,tx_entries=1; - for (uint32_t cnt=0; cnt>",lp); // add meters line -1,1-0:1.8.0*255(@10000,H2OIN,cbm,COUNTER,4| - if (*lp1=='-') lp1++; - uint8_t mnum=strtol(lp1,0,10); - if (mnum<1 || mnum>meters_used) goto next_line; + if (*lp1 == '-') lp1++; + uint8_t mnum = strtol(lp1, 0, 10); + if (mnum < 1 || mnum > meters_used) { + AddLog(LOG_LEVEL_INFO, PSTR("illegal meter number!")); + goto next_line; + } + // 1,=h————————————— + if (strncmp(lp1 + 1, ",=h", 3)) { + dec_line++; + if (dec_line >= SML_MAX_VARS) { + AddLog(LOG_LEVEL_INFO, PSTR("too many decode lines: %d !"), dec_line); + goto next_line; + } + } while (1) { - if (*lp1==0) { - *tp++='|'; + if (*lp1 == 0) { + *tp++ = '|'; goto next_line; } - *tp++=*lp1++; + *tp++ = *lp1++; index++; - if (index>=METER_DEF_SIZE) break; + if (index >= METER_DEF_SIZE) break; } } #else - if (*lp=='-' || isdigit(*lp)) { + if (*lp == '-' || isdigit(*lp)) { //toLogEOL(">>",lp); // add meters line -1,1-0:1.8.0*255(@10000,H2OIN,cbm,COUNTER,4| - if (*lp=='-') lp++; - uint8_t mnum=strtol(lp,0,10); - if (mnum<1 || mnum>meters_used) goto next_line; + if (*lp == '-') lp++; + uint8_t mnum = strtol(lp,0,10); + if (mnum < 1 || mnum > meters_used) { + AddLog(LOG_LEVEL_INFO, PSTR("illegal meter number!")); + goto next_line; + } + if (strncmp(lp + 1, ",=h", 3)) { + dec_line++; + if (dec_line >= SML_MAX_VARS) { + AddLog(LOG_LEVEL_INFO, PSTR("too many decode lines: %d !"), dec_line); + goto next_line; + } + } + while (1) { - if (*lp==SCRIPT_EOL) { - if (*(tp-1)!='|') *tp++='|'; + if (*lp == SCRIPT_EOL) { + if (*(tp-1) != '|') *tp++ = '|'; goto next_line; } - *tp++=*lp++; + *tp++ = *lp++; index++; - if (index>=METER_DEF_SIZE) break; + if (index >= METER_DEF_SIZE) break; } + } #endif From a321ff55625d8a82b02d0c6c1663269549a361ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ara=C3=BAjo?= Date: Mon, 22 Feb 2021 10:40:37 +0000 Subject: [PATCH 06/12] Fix Ezo D.O sensor - Unit of measure was in ppm and should be in mg/L - Sensor was not detected - Code fixes on multiple ezo sensors --- tasmota/i18n.h | 2 +- tasmota/language/af_AF.h | 1 + tasmota/language/bg_BG.h | 1 + tasmota/language/cs_CZ.h | 1 + tasmota/language/de_DE.h | 1 + tasmota/language/el_GR.h | 1 + tasmota/language/en_GB.h | 1 + tasmota/language/es_ES.h | 1 + tasmota/language/fr_FR.h | 1 + tasmota/language/fy_NL.h | 1 + tasmota/language/he_HE.h | 1 + tasmota/language/hu_HU.h | 1 + tasmota/language/it_IT.h | 1 + tasmota/language/ko_KO.h | 1 + tasmota/language/nl_NL.h | 1 + tasmota/language/pl_PL.h | 1 + tasmota/language/pt_BR.h | 2 ++ tasmota/language/pt_PT.h | 1 + tasmota/language/ro_RO.h | 1 + tasmota/language/ru_RU.h | 1 + tasmota/language/sk_SK.h | 1 + tasmota/language/sv_SE.h | 1 + tasmota/language/tr_TR.h | 1 + tasmota/language/uk_UA.h | 1 + tasmota/language/vi_VN.h | 1 + tasmota/language/zh_CN.h | 1 + tasmota/language/zh_TW.h | 1 + tasmota/xsns_78_ezoco2.ino | 3 +-- tasmota/xsns_78_ezodo.ino | 11 ++++++----- tasmota/xsns_78_ezoec.ino | 3 +-- tasmota/xsns_78_ezoo2.ino | 3 +-- tasmota/xsns_78_ezoorp.ino | 3 +-- tasmota/xsns_78_ezoph.ino | 3 +-- tasmota/xsns_78_ezoprs.ino | 3 +-- tasmota/xsns_78_ezortd.ino | 3 +-- 35 files changed, 41 insertions(+), 20 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 0edd337faf40..bff6c16121bf 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -829,7 +829,7 @@ const char HTTP_SNS_EC[] PROGMEM = "{s}%s " D_EC "{ const char HTTP_SNS_O2[] PROGMEM = "{s}%s " D_O2 "{m}%s " D_UNIT_PERCENT "{e}"; const char HTTP_SNS_LITERS[] PROGMEM = "{s}%s " D_VOLUME "{m}%s " D_UNIT_LITERS "{e}"; const char HTTP_SNS_LPM[] PROGMEM = "{s}%s " D_FLOW_RATE "{m}%s " D_UNIT_LITERS_PER_MIN "{e}"; -const char HTTP_SNS_DO[] PROGMEM = "{s}%s " D_DO "{m}%s " D_UNIT_PARTS_PER_MILLION "{e}"; +const char HTTP_SNS_DO[] PROGMEM = "{s}%s " D_DO "{m}%s " D_UNIT_MILIGRAMS_PER_LITER "{e}"; const char HTTP_SNS_COLOR_RED[] PROGMEM = "{s}%s " D_COLOR_RED "{m}%u " "{e}"; const char HTTP_SNS_COLOR_GREEN[] PROGMEM = "{s}%s " D_COLOR_GREEN "{m}%u " "{e}"; const char HTTP_SNS_COLOR_BLUE[] PROGMEM = "{s}%s " D_COLOR_BLUE "{m}%u " "{e}"; diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 90d12bfa936c..07e8a88fa3ac 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 078298d2715c..9f222a84c66d 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -826,6 +826,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index b252002bb614..1e9382216835 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index 8c3dac821ae5..cde12947cf69 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 0b324b607b85..7ba39fa04540 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 0d0f0b3c9367..8a71486f557d 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 5fc31926df05..f5e3e8d2aa53 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "seg" diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index a07e6dde374a..1a8eb94fe238 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -823,6 +823,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index 3ac159c0bb15..fcb977be1c4a 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index eb68c4ba5cce..79cc2c3b8cea 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index f24a894c50f4..39bfa265c1c1 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index c3d516d5787b..20b1957f0619 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -826,6 +826,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 1463febd9d72..22f98997ba0c 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "초" diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index 2b8730d9ef97..875f25551a5d 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index e356bb6270eb..6301a4e1aec9 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" + #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 968c04065b0d..e080577c5ee8 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -827,6 +827,8 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" + + #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 9baa0c300948..2f26b2e64522 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 155bf020fe89..e00935295aaf 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 2390db6c8162..c9d8c1166896 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "гПа" #define D_UNIT_SECOND "сек" diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index cc803e84f14b..b752d20fe43d 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sek" diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 9fa5c17ba4da..7105f64a9966 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sek" diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index a660dc79746f..a23f686fe471 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 0b9346ceb70e..83c78b23fa2e 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "млрд⁻¹" #define D_UNIT_PARTS_PER_DECILITER "децилітр⁻¹" #define D_UNIT_PARTS_PER_MILLION "млн⁻¹" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "гПа" #define D_UNIT_SECOND "сек" diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index 2e017328982b..329f7ebe8219 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 9e5d6b0a71d8..85e7381c40d2 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "每分升" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "百帕" #define D_UNIT_SECOND "秒" diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 7ea86dbc7a9a..34ff54547124 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -827,6 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "每分升" #define D_UNIT_PARTS_PER_MILLION "ppm" +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "百帕" #define D_UNIT_SECOND "秒" diff --git a/tasmota/xsns_78_ezoco2.ino b/tasmota/xsns_78_ezoco2.ino index 8d038308a750..d15c04ba784b 100644 --- a/tasmota/xsns_78_ezoco2.ino +++ b/tasmota/xsns_78_ezoco2.ino @@ -41,9 +41,8 @@ struct EZOCO2 : public EZOStruct { { if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_CO2 "\":%d}" ), name, CO2); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_CO2, name, CO2); #endif // USE_WEBSERVER } diff --git a/tasmota/xsns_78_ezodo.ino b/tasmota/xsns_78_ezodo.ino index 8a22bceb3555..843376930981 100644 --- a/tasmota/xsns_78_ezodo.ino +++ b/tasmota/xsns_78_ezodo.ino @@ -23,7 +23,7 @@ #define EZO_DO_READ_LATENCY 600 struct EZODO : public EZOStruct { - EZODO(uint32_t addr) : EZOStruct(addr), DO(0) {} + EZODO(uint32_t addr) : EZOStruct(addr), DO(NAN) {} virtual void ProcessMeasurement(void) { @@ -39,10 +39,11 @@ struct EZODO : public EZOStruct { dtostrfd(DO, 2, str); if (json) { - ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_DO "\":%d}" ), name, str); - } + ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_DO "\":%s" ), name, str); + ResponseJsonEnd(); + #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_DO, name, str); #endif // USE_WEBSERVER } @@ -54,7 +55,7 @@ private: float DO; }; -const char EZODO::id[] PROGMEM = "D.O."; +const char EZODO::id[] PROGMEM = "DO"; #endif // USE_EZODO #endif // USE_I2C diff --git a/tasmota/xsns_78_ezoec.ino b/tasmota/xsns_78_ezoec.ino index e134e4da11fe..f09482c442ed 100644 --- a/tasmota/xsns_78_ezoec.ino +++ b/tasmota/xsns_78_ezoec.ino @@ -40,9 +40,8 @@ struct EZOEC : public EZOStruct { if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_EC "\":%s}" ), name, str); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_EC, name, str); #endif // USE_WEBSERVER } diff --git a/tasmota/xsns_78_ezoo2.ino b/tasmota/xsns_78_ezoo2.ino index cafdeb813d30..ffeea4a86a03 100644 --- a/tasmota/xsns_78_ezoo2.ino +++ b/tasmota/xsns_78_ezoo2.ino @@ -40,9 +40,8 @@ struct EZOO2 : public EZOStruct { if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_O2 "\":%d}" ), name, str); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_O2, name, str); #endif // USE_WEBSERVER } diff --git a/tasmota/xsns_78_ezoorp.ino b/tasmota/xsns_78_ezoorp.ino index 09db9983c850..59c99c8609ed 100644 --- a/tasmota/xsns_78_ezoorp.ino +++ b/tasmota/xsns_78_ezoorp.ino @@ -40,9 +40,8 @@ struct EZOORP : public EZOStruct { if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_ORP "\":%s}" ), name, str); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_ORP, name, str); #endif // USE_WEBSERVER } diff --git a/tasmota/xsns_78_ezoph.ino b/tasmota/xsns_78_ezoph.ino index c4e6a742509d..f55f4a575cf2 100644 --- a/tasmota/xsns_78_ezoph.ino +++ b/tasmota/xsns_78_ezoph.ino @@ -40,9 +40,8 @@ struct EZOPH : public EZOStruct { if (json) { ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_PH "\":%s}" ), name, str); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_PH, name, str); #endif // USE_WEBSERVER } diff --git a/tasmota/xsns_78_ezoprs.ino b/tasmota/xsns_78_ezoprs.ino index f80eba82ebae..7c9ac2872df7 100644 --- a/tasmota/xsns_78_ezoprs.ino +++ b/tasmota/xsns_78_ezoprs.ino @@ -46,9 +46,8 @@ struct EZOPRS : public EZOStruct { ResponseAppend_P(PSTR(",\"" D_JSON_PRESSUREATSEALEVEL "\":%s"), sealevelstr); } ResponseJsonEnd(); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_PD(HTTP_SNS_PRESSURE, name, str, PressureUnit().c_str()); if (Settings.altitude != 0) { WSContentSend_PD(HTTP_SNS_SEAPRESSURE, name, sealevelstr, PressureUnit().c_str()); diff --git a/tasmota/xsns_78_ezortd.ino b/tasmota/xsns_78_ezortd.ino index c9d37fa68db0..79925773e4b2 100644 --- a/tasmota/xsns_78_ezortd.ino +++ b/tasmota/xsns_78_ezortd.ino @@ -39,9 +39,8 @@ struct EZORTD : public EZOStruct { if (json) { ResponseAppend_P(JSON_SNS_F_TEMP, name, Settings.flag2.temperature_resolution, &temp); - } #ifdef USE_WEBSERVER - else { + }else { WSContentSend_Temp(name, temp); #endif // USE_WEBSERVER } From fb012c50960ed7a8a62ed635a5311ed503c2dfb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ara=C3=BAjo?= Date: Mon, 22 Feb 2021 11:15:39 +0000 Subject: [PATCH 07/12] Fix CI translation errors --- tasmota/language/pl_PL.h | 2 +- tasmota/language/pt_BR.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index 6301a4e1aec9..825448a04574 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -827,7 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" - +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "sec" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index e080577c5ee8..68e4e4df15b3 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -827,8 +827,7 @@ #define D_UNIT_PARTS_PER_BILLION "ppb" #define D_UNIT_PARTS_PER_DECILITER "ppd" #define D_UNIT_PARTS_PER_MILLION "ppm" - - +#define D_UNIT_MILIGRAMS_PER_LITER "mg/L" #define D_UNIT_PERCENT "%%" #define D_UNIT_PRESSURE "hPa" #define D_UNIT_SECOND "s" From dde67c5b460caf31efd6e1636eb6069430fc7d74 Mon Sep 17 00:00:00 2001 From: JeroenSt Date: Mon, 22 Feb 2021 09:11:36 +0100 Subject: [PATCH 08/12] Added options to retain info and state mqtt messages https://github.com/arendst/Tasmota/discussions/11067 Changed version to current version in comments https://github.com/arendst/Tasmota/pull/11079#discussion_r580057981 --- tasmota/i18n.h | 2 ++ tasmota/my_user_config.h | 2 ++ tasmota/settings.h | 4 ++-- tasmota/settings.ino | 2 ++ tasmota/support_command.ino | 9 ++++++--- tasmota/support_tasmota.ino | 2 +- tasmota/xdrv_02_mqtt.ino | 38 ++++++++++++++++++++++++++++++------- 7 files changed, 46 insertions(+), 13 deletions(-) diff --git a/tasmota/i18n.h b/tasmota/i18n.h index 0edd337faf40..fc45e7fc1d83 100644 --- a/tasmota/i18n.h +++ b/tasmota/i18n.h @@ -380,6 +380,8 @@ #define D_CMND_SWITCHRETAIN "SwitchRetain" #define D_CMND_POWERRETAIN "PowerRetain" #define D_CMND_SENSORRETAIN "SensorRetain" +#define D_CMND_INFORETAIN "InfoRetain" +#define D_CMND_STATERETAIN "StateRetain" #define D_CMND_PUBLISH "Publish" // Commands xdrv_01_webserver.ino diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index ac0d48699316..b35a1c4757a9 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -112,6 +112,8 @@ #define MQTT_POWER_RETAIN false // [PowerRetain] Power status message may send retain flag (false = off, true = on) #define MQTT_SWITCH_RETAIN false // [SwitchRetain] Switch may send retain flag (false = off, true = on) #define MQTT_SENSOR_RETAIN false // [SensorRetain] Sensor may send retain flag (false = off, true = on) +#define MQTT_INFO_RETAIN false // [InfoRetain] Info may send retain flag (false = off, true = on) +#define MQTT_STATE_RETAIN false // [StateRetain] State may send retain flag (false = off, true = on) #define MQTT_NO_HOLD_RETAIN false // [SetOption62] Disable retain flag on HOLD messages #define MQTT_NO_RETAIN false // [SetOption104] No Retain - disable all MQTT retained messages, some brokers don't support it: AWS IoT, Losant diff --git a/tasmota/settings.h b/tasmota/settings.h index 5f8484ea0135..cb70f0a27e86 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -146,8 +146,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t zb_received_as_subtopic : 1; // bit 4 (v9.2.0.3) - SetOption118 - (Zigbee) Move ZbReceived from JSON message and into the subtopic replacing "SENSOR" default uint32_t zb_omit_json_addr : 1; // bit 5 (v9.2.0.3) - SetOption119 - (Zigbee) Remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic uint32_t zb_topic_endpoint : 1; // bit 6 (v9.2.0.4) - SetOption120 - (Zigbee) Append endpoint number to topic if device dependent (use with SetOption89) - uint32_t spare07 : 1; // bit 7 - uint32_t spare08 : 1; // bit 8 + uint32_t mqtt_state_retain : 1; // bit 7 (v9.3.0.1) - CMND_STATERETAIN + uint32_t mqtt_info_retain : 1; // bit 8 (v9.3.0.1) - CMND_INFORETAIN uint32_t spare09 : 1; // bit 9 uint32_t spare10 : 1; // bit 10 uint32_t spare11 : 1; // bit 11 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 9a9d9dcb6a64..d4857bb15952 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -831,6 +831,8 @@ void SettingsDefaultSet2(void) { flag.mqtt_button_retain |= MQTT_BUTTON_RETAIN; flag.mqtt_switch_retain |= MQTT_SWITCH_RETAIN; flag.mqtt_sensor_retain |= MQTT_SENSOR_RETAIN; + flag5.mqtt_info_retain |= MQTT_INFO_RETAIN; + flag5.mqtt_state_retain |= MQTT_STATE_RETAIN; // flag.mqtt_serial |= 0; flag.device_index_enable |= MQTT_POWER_FORMAT; flag3.time_append_timezone |= MQTT_APPEND_TIMEZONE; diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index f75a5cd891f1..3ce30232ce7c 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -426,7 +426,8 @@ void CmndStatus(void) Response_P(PSTR("{\"" D_CMND_STATUS "\":{\"" D_CMND_MODULE "\":%d,\"" D_CMND_DEVICENAME "\":\"%s\",\"" D_CMND_FRIENDLYNAME "\":[%s],\"" D_CMND_TOPIC "\":\"%s\",\"" D_CMND_BUTTONTOPIC "\":\"%s\",\"" D_CMND_POWER "\":%d,\"" D_CMND_POWERONSTATE "\":%d,\"" D_CMND_LEDSTATE "\":%d,\"" D_CMND_LEDMASK "\":\"%04X\",\"" D_CMND_SAVEDATA "\":%d,\"" D_JSON_SAVESTATE "\":%d,\"" D_CMND_SWITCHTOPIC "\":\"%s\",\"" - D_CMND_SWITCHMODE "\":[%s],\"" D_CMND_BUTTONRETAIN "\":%d,\"" D_CMND_SWITCHRETAIN "\":%d,\"" D_CMND_SENSORRETAIN "\":%d,\"" D_CMND_POWERRETAIN "\":%d}}"), + D_CMND_SWITCHMODE "\":[%s],\"" D_CMND_BUTTONRETAIN "\":%d,\"" D_CMND_SWITCHRETAIN "\":%d,\"" D_CMND_SENSORRETAIN "\":%d,\"" D_CMND_POWERRETAIN "\":%d,\"" + D_CMND_POWERRETAIN "\":%d,\"" D_CMND_INFORETAIN "\":%d,\"" D_CMND_STATERETAIN "\":%d}}"), ModuleNr(), EscapeJSONString(SettingsText(SET_DEVICENAME)).c_str(), stemp, TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_BUTTON_TOPIC), TasmotaGlobal.power, Settings.poweronstate, Settings.ledstate, Settings.ledmask, Settings.save_data, @@ -436,7 +437,9 @@ void CmndStatus(void) Settings.flag.mqtt_button_retain, // CMND_BUTTONRETAIN Settings.flag.mqtt_switch_retain, // CMND_SWITCHRETAIN Settings.flag.mqtt_sensor_retain, // CMND_SENSORRETAIN - Settings.flag.mqtt_power_retain); // CMND_POWERRETAIN + Settings.flag.mqtt_power_retain, // CMND_POWERRETAIN + Settings.flag5.mqtt_info_retain, // CMND_INFORETAIN + Settings.flag5.mqtt_state_retain); // CMND_STATERETAIN MqttPublishPrefixTopic_P(STAT, PSTR(D_CMND_STATUS)); } @@ -629,7 +632,7 @@ void CmndState(void) ResponseClear(); MqttShowState(); if (Settings.flag3.hass_tele_on_power) { // SetOption59 - Send tele/%topic%/STATE in addition to stat/%topic%/RESULT - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), MQTT_TELE_RETAIN); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), Settings.flag5.mqtt_state_retain); } #ifdef USE_HOME_ASSISTANT if (Settings.flag.hass_discovery) { // SetOption19 - Control Home Assistantautomatic discovery (See SetOption59) diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index af9aca1e2bc1..1e57256e68d1 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -715,7 +715,7 @@ void MqttPublishTeleState(void) { ResponseClear(); MqttShowState(); - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), MQTT_TELE_RETAIN); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), Settings.flag5.mqtt_state_retain); #ifdef USE_DT_VARS DTVarsTeleperiod(); diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index 646df7037b8c..b90007e44255 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -48,7 +48,8 @@ const char kMqttCommands[] PROGMEM = "|" // No prefix #endif D_CMND_MQTTHOST "|" D_CMND_MQTTPORT "|" D_CMND_MQTTRETRY "|" D_CMND_STATETEXT "|" D_CMND_MQTTCLIENT "|" D_CMND_FULLTOPIC "|" D_CMND_PREFIX "|" D_CMND_GROUPTOPIC "|" D_CMND_TOPIC "|" D_CMND_PUBLISH "|" D_CMND_MQTTLOG "|" - D_CMND_BUTTONTOPIC "|" D_CMND_SWITCHTOPIC "|" D_CMND_BUTTONRETAIN "|" D_CMND_SWITCHRETAIN "|" D_CMND_POWERRETAIN "|" D_CMND_SENSORRETAIN ; + D_CMND_BUTTONTOPIC "|" D_CMND_SWITCHTOPIC "|" D_CMND_BUTTONRETAIN "|" D_CMND_SWITCHRETAIN "|" D_CMND_POWERRETAIN "|" + D_CMND_SENSORRETAIN "|" D_CMND_INFORETAIN "|" D_CMND_STATERETAIN ; SO_SYNONYMS(kMqttSynonyms, 90, @@ -73,7 +74,8 @@ void (* const MqttCommand[])(void) PROGMEM = { #endif &CmndMqttHost, &CmndMqttPort, &CmndMqttRetry, &CmndStateText, &CmndMqttClient, &CmndFullTopic, &CmndPrefix, &CmndGroupTopic, &CmndTopic, &CmndPublish, &CmndMqttlog, - &CmndButtonTopic, &CmndSwitchTopic, &CmndButtonRetain, &CmndSwitchRetain, &CmndPowerRetain, &CmndSensorRetain }; + &CmndButtonTopic, &CmndSwitchTopic, &CmndButtonRetain, &CmndSwitchRetain, &CmndPowerRetain, &CmndSensorRetain, + &CmndInfoRetain, &CmndStateRetain }; struct MQTT { uint16_t connect_count = 0; // MQTT re-connect count @@ -542,17 +544,17 @@ void MqttConnected(void) { char stopic2[TOPSZ]; Response_P(PSTR("{\"" D_CMND_MODULE "\":\"%s\",\"" D_JSON_VERSION "\":\"%s%s\",\"" D_JSON_FALLBACKTOPIC "\":\"%s\",\"" D_CMND_GROUPTOPIC "\":\"%s\"}"), ModuleName().c_str(), TasmotaGlobal.version, TasmotaGlobal.image_name, GetFallbackTopic_P(stopic, ""), GetGroupTopic_P(stopic2, "", SET_MQTT_GRP_TOPIC)); - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "1")); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "1"), Settings.flag5.mqtt_info_retain); #ifdef USE_WEBSERVER if (Settings.webserver) { #if LWIP_IPV6 Response_P(PSTR("{\"" D_JSON_WEBSERVER_MODE "\":\"%s\",\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\",\"IPv6Address\":\"%s\"}"), - (2 == Settings.webserver) ? PSTR(D_ADMIN) : PSTR(D_USER), NetworkHostname(), NetworkAddress().toString().c_str(), WifiGetIPv6().c_str()); + (2 == Settings.webserver) ? PSTR(D_ADMIN) : PSTR(D_USER), NetworkHostname(), NetworkAddress().toString().c_str(), WifiGetIPv6().c_str(), Settings.flag5.mqtt_info_retain); #else Response_P(PSTR("{\"" D_JSON_WEBSERVER_MODE "\":\"%s\",\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%s\"}"), - (2 == Settings.webserver) ? PSTR(D_ADMIN) : PSTR(D_USER), NetworkHostname(), NetworkAddress().toString().c_str()); + (2 == Settings.webserver) ? PSTR(D_ADMIN) : PSTR(D_USER), NetworkHostname(), NetworkAddress().toString().c_str(), Settings.flag5.mqtt_info_retain); #endif // LWIP_IPV6 = 1 - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "2")); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "2"), Settings.flag5.mqtt_info_retain); } #endif // USE_WEBSERVER Response_P(PSTR("{\"" D_JSON_RESTARTREASON "\":")); @@ -562,7 +564,7 @@ void MqttConnected(void) { ResponseAppend_P(PSTR("\"%s\""), GetResetReason().c_str()); } ResponseJsonEnd(); - MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "3")); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO "3"), Settings.flag5.mqtt_info_retain); } MqttPublishAllPowerState(); @@ -1080,6 +1082,28 @@ void CmndSensorRetain(void) { ResponseCmndStateText(Settings.flag.mqtt_sensor_retain); // CMND_SENSORRETAIN } +void CmndInfoRetain(void) { + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + if (!XdrvMailbox.payload) { + ResponseClear(); + MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_INFO), Settings.flag5.mqtt_info_retain); // CMND_INFORETAIN + } + Settings.flag5.mqtt_info_retain = XdrvMailbox.payload; // CMND_INFORETAIN + } + ResponseCmndStateText(Settings.flag5.mqtt_info_retain); // CMND_INFORETAIN +} + +void CmndStateRetain(void) { + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + if (!XdrvMailbox.payload) { + ResponseClear(); + MqttPublishPrefixTopic_P(STAT, PSTR(D_RSLT_STATE), Settings.flag5.mqtt_state_retain); // CMND_STATERETAIN + } + Settings.flag5.mqtt_state_retain = XdrvMailbox.payload; // CMND_STATERETAIN + } + ResponseCmndStateText(Settings.flag5.mqtt_state_retain); // CMND_STATERETAIN +} + /*********************************************************************************************\ * TLS private key and certificate - store into Flash \*********************************************************************************************/ From d289608fe42b87ebc7c1e2b8285c6a053dcf7ecc Mon Sep 17 00:00:00 2001 From: JeroenSt Date: Mon, 22 Feb 2021 13:36:26 +0100 Subject: [PATCH 09/12] Solved duplicate entry D_CMND_POWERRETAIN https://github.com/arendst/Tasmota/pull/11084#discussion_r580203530 --- tasmota/support_command.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 3ce30232ce7c..643327aae8f2 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -427,7 +427,7 @@ void CmndStatus(void) D_CMND_BUTTONTOPIC "\":\"%s\",\"" D_CMND_POWER "\":%d,\"" D_CMND_POWERONSTATE "\":%d,\"" D_CMND_LEDSTATE "\":%d,\"" D_CMND_LEDMASK "\":\"%04X\",\"" D_CMND_SAVEDATA "\":%d,\"" D_JSON_SAVESTATE "\":%d,\"" D_CMND_SWITCHTOPIC "\":\"%s\",\"" D_CMND_SWITCHMODE "\":[%s],\"" D_CMND_BUTTONRETAIN "\":%d,\"" D_CMND_SWITCHRETAIN "\":%d,\"" D_CMND_SENSORRETAIN "\":%d,\"" D_CMND_POWERRETAIN "\":%d,\"" - D_CMND_POWERRETAIN "\":%d,\"" D_CMND_INFORETAIN "\":%d,\"" D_CMND_STATERETAIN "\":%d}}"), + D_CMND_INFORETAIN "\":%d,\"" D_CMND_STATERETAIN "\":%d}}"), ModuleNr(), EscapeJSONString(SettingsText(SET_DEVICENAME)).c_str(), stemp, TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_BUTTON_TOPIC), TasmotaGlobal.power, Settings.poweronstate, Settings.ledstate, Settings.ledmask, Settings.save_data, From e2ab1fe3f3de7c03109f8999be24c89aa3f3a172 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 22 Feb 2021 13:46:25 +0100 Subject: [PATCH 10/12] Update changelog --- CHANGELOG.md | 9 +++++++-- RELEASENOTES.md | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bec272b29044..a11f5d49bb7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,16 +4,21 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development ## [9.3.0.1] +### Added +- Animate PWM dimmer brightness LEDs during transitions and with variable brightness (#11076) + ### Changed - Remove the need to start filenames with a slash (/) in Ufs commands - Removed command ``VirtualCT`` as synonym for ``SetOption106`` (#11049) ### Fixed +- Web request accepts wrong password (#11039) - Ili1942 driver (#11046) -- Shutter driver (#11055) - ESP32 Mi32 driver (#11048) +- Shutter driver (#11055) - TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable (#11057) -- Web request accepts wrong password (#11039) +- Sml driver (#11082) +- Ezo drivers (#11083) ## [Released] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8f8ac126a97a..7f9ceeb221d9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -79,13 +79,18 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota [Complete list](BUILDS.md) of available feature and sensors. ## Changelog v9.3.0.1 +### Added +- Animate PWM dimmer brightness LEDs during transitions and with variable brightness [#11076](https://github.com/arendst/Tasmota/issues/11076) + ### Changed - Remove the need to start filenames with a slash (/) in Ufs commands - Removed command ``VirtualCT`` as synonym for ``SetOption106`` [#11049](https://github.com/arendst/Tasmota/issues/11049) ### Fixed +- Web request accepts wrong password [#11039](https://github.com/arendst/Tasmota/issues/11039) - Ili1942 driver [#11046](https://github.com/arendst/Tasmota/issues/11046) -- Shutter driver [#11055](https://github.com/arendst/Tasmota/issues/11055) - ESP32 Mi32 driver [#11048](https://github.com/arendst/Tasmota/issues/11048) +- Shutter driver [#11055](https://github.com/arendst/Tasmota/issues/11055) - TM1637 driver now needs ``TM1637 CLK`` and ``TM1637 DIO`` to enable [#11057](https://github.com/arendst/Tasmota/issues/11057) -- Web request accepts wrong password [#11039](https://github.com/arendst/Tasmota/issues/11039) +- Sml driver [#11082](https://github.com/arendst/Tasmota/issues/11082) +- Ezo drivers [#11083](https://github.com/arendst/Tasmota/issues/11083) From 9edccbbca596271b1349ee5b0c39861f2a8bcfcf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 22 Feb 2021 13:59:45 +0100 Subject: [PATCH 11/12] Add commands ``StateRetain`` and ``InfoRetain`` (#11084) --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + tools/decode-status.py | 8 +++++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a11f5d49bb7a..2f4e55b47fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file. ## [9.3.0.1] ### Added - Animate PWM dimmer brightness LEDs during transitions and with variable brightness (#11076) +- Commands ``StateRetain`` and ``InfoRetain`` (#11084) ### Changed - Remove the need to start filenames with a slash (/) in Ufs commands diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7f9ceeb221d9..ec5a31a34dbb 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -81,6 +81,7 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota ## Changelog v9.3.0.1 ### Added - Animate PWM dimmer brightness LEDs during transitions and with variable brightness [#11076](https://github.com/arendst/Tasmota/issues/11076) +- Commands ``StateRetain`` and ``InfoRetain`` [#11084](https://github.com/arendst/Tasmota/issues/11084) ### Changed - Remove the need to start filenames with a slash (/) in Ufs commands diff --git a/tools/decode-status.py b/tools/decode-status.py index 9ab99763ff22..bd1f959a864d 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -174,8 +174,10 @@ "(Light) run fading at fixed duration instead of fixed slew rate", "(Zigbee) Move ZbReceived from JSON message and into the subtopic replacing SENSOR default", "(Zigbee) Remove the device addr from json payload, can be used with zb_topic_fname where the addr is already known from the topic", - "","", - "","","","", + "(Zigbee) Append endpoint number to topic if device dependent (use with SetOption89)", + "(MQTT) Retain on State", + "(MQTT) Retain on Info", + "","","", "","","","", "","","","", "","","","", @@ -282,7 +284,7 @@ obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v20210217 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v20210222 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj)) From 0906acc25ecf05f2e0fdaf56ad56db3327119e22 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 22 Feb 2021 14:05:27 +0100 Subject: [PATCH 12/12] Update en_GB.h Inline with other checkboxes --- tasmota/language/en_GB.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 081e3c2ae2d5..a092159ae4da 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -884,7 +884,7 @@ #define D_SCRIPT_CHARS_LEFT "chars left" #define D_SCRIPT_CHARS_NO_MORE "no more chars" #define D_SCRIPT_DOWNLOAD "Download" -#define D_SCRIPT_ENABLE "Script enabled" +#define D_SCRIPT_ENABLE "Script enable" #define D_SCRIPT_UPLOAD "Upload" #define D_SCRIPT_UPLOAD_FILES "Upload files"