From 3ba19e1552e729ecd445ccf98c84909077bf1f90 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 21 Dec 2020 14:27:21 +0100 Subject: [PATCH] Add backported fixes --- CHANGELOG.md | 11 ++++++++--- RELEASENOTES.md | 6 ++++++ tasmota/settings.ino | 3 ++- tasmota/xdrv_05_irremote.ino | 7 +++++++ tasmota/xdrv_21_wemo.ino | 2 +- tasmota/xdrv_21_wemo_multi.ino | 10 +++++++--- tasmota/xdrv_45_shelly_dimmer.ino | 8 ++++---- 7 files changed, 35 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9efb3c2a4..821b80c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,17 @@ All notable changes to this project will be documented in this file. ## [Released] +## [9.2.0] 20201221 +### Fixed Backported +- Shelly Dimmer power on state (#10154, #10182) +- Wemo emulation for single devices (#10165, #10194) +- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) +- Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 + ## [9.2.0] 20201216 - Release Julie -## [Unreleased] - Development - -## [9.1.0.2] +## [9.1.0.2] 20201216 ### Added - KNX read reply for Power (#9236, #9891) - Zigbee persistence of device/sensor data in EEPROM (only ZBBridge) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b360a7337..9e3431715 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -112,6 +112,12 @@ The attached binaries can also be downloaded from http://ota.tasmota.com/tasmota - ESP32 CC2530 heap corruption [#10121](https://github.com/arendst/Tasmota/issues/10121) - ESP32 Analog input div10 rule trigger [#10149](https://github.com/arendst/Tasmota/issues/10149) +### Fixed Backported +- Shelly Dimmer power on state (#10154, #10182) +- Wemo emulation for single devices (#10165, #10194) +- ESP32 LoadStoreError when using ``#define USER_TEMPLATE`` (#9506) +- Compile error when ``#ifdef USE_IR_RECEIVE`` is disabled regression from 9.1.0.2 + ### Removed - Version compatibility check - PN532 define USE_PN532_CAUSE_EVENTS replaced by generic rule trigger `on pn532#uid=` diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 2ce535710..859960472 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -1049,7 +1049,8 @@ void SettingsDefaultSet2(void) flag4.mqtt_no_retain |= MQTT_NO_RETAIN; #ifdef USER_TEMPLATE - JsonTemplate((char *)USER_TEMPLATE); + String user_template = USER_TEMPLATE; + JsonTemplate((char*)user_template.c_str()); #endif Settings.flag = flag; diff --git a/tasmota/xdrv_05_irremote.ino b/tasmota/xdrv_05_irremote.ino index cd401d7c0..6e3bad365 100644 --- a/tasmota/xdrv_05_irremote.ino +++ b/tasmota/xdrv_05_irremote.ino @@ -290,7 +290,10 @@ uint32_t IrRemoteCmndIrSendJson(void) AddLog_P(LOG_LEVEL_DEBUG, PSTR("IRS: protocol_text %s, protocol %s, bits %d, data %s (0x%s), repeat %d, protocol_code %d"), protocol_text, protocol, bits, ulltoa(data, dvalue, 10), Uint64toHex(data, hvalue, bits), repeat, protocol_code); +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->disableIRIn(); } +#endif // USE_IR_RECEIVE + switch (protocol_code) { // Equals IRremoteESP8266.h enum decode_type_t #ifdef USE_IR_SEND_RC5 case RC5: @@ -305,10 +308,14 @@ uint32_t IrRemoteCmndIrSendJson(void) irsend->sendNEC(data, (bits > NEC_BITS) ? NEC_BITS : bits, repeat); break; #endif default: +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->enableIRIn(); } +#endif // USE_IR_RECEIVE return IE_PROTO_UNSUPPORTED; } +#ifdef USE_IR_RECEIVE if (irrecv != nullptr) { irrecv->enableIRIn(); } +#endif // USE_IR_RECEIVE return IE_NO_ERROR; } diff --git a/tasmota/xdrv_21_wemo.ino b/tasmota/xdrv_21_wemo.ino index 6ffb7cd3c..51ddcc33d 100644 --- a/tasmota/xdrv_21_wemo.ino +++ b/tasmota/xdrv_21_wemo.ino @@ -17,7 +17,7 @@ along with this program. If not, see . */ -#if defined(USE_WEBSERVER) && defined(USE_EMULATION) && defined (USE_EMULATION_WEMO_SINGLE) +#if defined(USE_WEBSERVER) && defined(USE_EMULATION) && defined(USE_EMULATION_WEMO_SINGLE) /*********************************************************************************************\ * Belkin WeMo emulation \*********************************************************************************************/ diff --git a/tasmota/xdrv_21_wemo_multi.ino b/tasmota/xdrv_21_wemo_multi.ino index 01b6d8cac..b281252bc 100644 --- a/tasmota/xdrv_21_wemo_multi.ino +++ b/tasmota/xdrv_21_wemo_multi.ino @@ -234,14 +234,18 @@ private: int _deviceId; String WemoSerialnumber(void) { - char serial[18]; + char serial[20]; - snprintf_P(serial, sizeof(serial), PSTR("201612K%08X-%d"), ESP_getChipId(), _deviceId); + char index[8] = { 0 }; + if (_deviceId > 1) { // Keep backward compatibility + snprintf_P(index, sizeof(index), PSTR("%02X"), _deviceId); + } + snprintf_P(serial, sizeof(serial), PSTR("201612K%08X%s"), ESP_getChipId(), index); return String(serial); } String WemoUuid(void) { - char uuid[29]; + char uuid[32]; snprintf_P(uuid, sizeof(uuid), PSTR("Socket-1_0-%s"), WemoSerialnumber().c_str()); return String(uuid); diff --git a/tasmota/xdrv_45_shelly_dimmer.ino b/tasmota/xdrv_45_shelly_dimmer.ino index 1e54678a9..ab5743bfa 100644 --- a/tasmota/xdrv_45_shelly_dimmer.ino +++ b/tasmota/xdrv_45_shelly_dimmer.ino @@ -626,9 +626,9 @@ bool ShdSendVersion(void) void ShdGetSettings(void) { char parameters[32]; - Shd.req_brightness = 0; + // Shd.req_brightness = 0; Shd.leading_edge = 0; - Shd.req_fade_rate = 0; + // Shd.req_fade_rate = 0; Shd.warmup_brightness = 0; Shd.warmup_time = 0; if (strstr(SettingsText(SET_SHD_PARAM), ",") != nullptr) @@ -636,9 +636,9 @@ void ShdGetSettings(void) #ifdef SHELLY_DIMMER_DEBUG AddLog_P(LOG_LEVEL_INFO, PSTR(SHD_LOGNAME "Loading params: %s"), SettingsText(SET_SHD_PARAM)); #endif // SHELLY_DIMMER_DEBUG - Shd.req_brightness = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 1)); + // Shd.req_brightness = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 1)); Shd.leading_edge = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 2)); - Shd.req_fade_rate = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 3)); + // Shd.req_fade_rate = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 3)); Shd.warmup_brightness = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 4)); Shd.warmup_time = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 5)); }