Add backported fixes

This commit is contained in:
Theo Arends 2020-12-21 14:27:21 +01:00
parent 08ec5cecda
commit 3ba19e1552
7 changed files with 35 additions and 12 deletions

View File

@ -3,12 +3,17 @@ All notable changes to this project will be documented in this file.
## [Released] ## [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 ## [9.2.0] 20201216
- Release Julie - Release Julie
## [Unreleased] - Development ## [9.1.0.2] 20201216
## [9.1.0.2]
### Added ### Added
- KNX read reply for Power (#9236, #9891) - KNX read reply for Power (#9236, #9891)
- Zigbee persistence of device/sensor data in EEPROM (only ZBBridge) - Zigbee persistence of device/sensor data in EEPROM (only ZBBridge)

View File

@ -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 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) - 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 ### Removed
- Version compatibility check - Version compatibility check
- PN532 define USE_PN532_CAUSE_EVENTS replaced by generic rule trigger `on pn532#uid=` - PN532 define USE_PN532_CAUSE_EVENTS replaced by generic rule trigger `on pn532#uid=`

View File

@ -1049,7 +1049,8 @@ void SettingsDefaultSet2(void)
flag4.mqtt_no_retain |= MQTT_NO_RETAIN; flag4.mqtt_no_retain |= MQTT_NO_RETAIN;
#ifdef USER_TEMPLATE #ifdef USER_TEMPLATE
JsonTemplate((char *)USER_TEMPLATE); String user_template = USER_TEMPLATE;
JsonTemplate((char*)user_template.c_str());
#endif #endif
Settings.flag = flag; Settings.flag = flag;

View File

@ -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"), 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); protocol_text, protocol, bits, ulltoa(data, dvalue, 10), Uint64toHex(data, hvalue, bits), repeat, protocol_code);
#ifdef USE_IR_RECEIVE
if (irrecv != nullptr) { irrecv->disableIRIn(); } if (irrecv != nullptr) { irrecv->disableIRIn(); }
#endif // USE_IR_RECEIVE
switch (protocol_code) { // Equals IRremoteESP8266.h enum decode_type_t switch (protocol_code) { // Equals IRremoteESP8266.h enum decode_type_t
#ifdef USE_IR_SEND_RC5 #ifdef USE_IR_SEND_RC5
case RC5: case RC5:
@ -305,10 +308,14 @@ uint32_t IrRemoteCmndIrSendJson(void)
irsend->sendNEC(data, (bits > NEC_BITS) ? NEC_BITS : bits, repeat); break; irsend->sendNEC(data, (bits > NEC_BITS) ? NEC_BITS : bits, repeat); break;
#endif #endif
default: default:
#ifdef USE_IR_RECEIVE
if (irrecv != nullptr) { irrecv->enableIRIn(); } if (irrecv != nullptr) { irrecv->enableIRIn(); }
#endif // USE_IR_RECEIVE
return IE_PROTO_UNSUPPORTED; return IE_PROTO_UNSUPPORTED;
} }
#ifdef USE_IR_RECEIVE
if (irrecv != nullptr) { irrecv->enableIRIn(); } if (irrecv != nullptr) { irrecv->enableIRIn(); }
#endif // USE_IR_RECEIVE
return IE_NO_ERROR; return IE_NO_ERROR;
} }

View File

@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#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 * Belkin WeMo emulation
\*********************************************************************************************/ \*********************************************************************************************/

View File

@ -234,14 +234,18 @@ private:
int _deviceId; int _deviceId;
String WemoSerialnumber(void) { 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); return String(serial);
} }
String WemoUuid(void) { String WemoUuid(void) {
char uuid[29]; char uuid[32];
snprintf_P(uuid, sizeof(uuid), PSTR("Socket-1_0-%s"), WemoSerialnumber().c_str()); snprintf_P(uuid, sizeof(uuid), PSTR("Socket-1_0-%s"), WemoSerialnumber().c_str());
return String(uuid); return String(uuid);

View File

@ -626,9 +626,9 @@ bool ShdSendVersion(void)
void ShdGetSettings(void) void ShdGetSettings(void)
{ {
char parameters[32]; char parameters[32];
Shd.req_brightness = 0; // Shd.req_brightness = 0;
Shd.leading_edge = 0; Shd.leading_edge = 0;
Shd.req_fade_rate = 0; // Shd.req_fade_rate = 0;
Shd.warmup_brightness = 0; Shd.warmup_brightness = 0;
Shd.warmup_time = 0; Shd.warmup_time = 0;
if (strstr(SettingsText(SET_SHD_PARAM), ",") != nullptr) if (strstr(SettingsText(SET_SHD_PARAM), ",") != nullptr)
@ -636,9 +636,9 @@ void ShdGetSettings(void)
#ifdef SHELLY_DIMMER_DEBUG #ifdef SHELLY_DIMMER_DEBUG
AddLog_P(LOG_LEVEL_INFO, PSTR(SHD_LOGNAME "Loading params: %s"), SettingsText(SET_SHD_PARAM)); AddLog_P(LOG_LEVEL_INFO, PSTR(SHD_LOGNAME "Loading params: %s"), SettingsText(SET_SHD_PARAM));
#endif // SHELLY_DIMMER_DEBUG #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.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_brightness = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 4));
Shd.warmup_time = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 5)); Shd.warmup_time = atoi(subStr(parameters, SettingsText(SET_SHD_PARAM), ",", 5));
} }