mirror of https://github.com/arendst/Tasmota.git
v5.7.0a - Add optional # to color
5.7.0a * Remove leading spaces from MQTT data * Fix webconsole special character entry * Allow # as prefix for color value
This commit is contained in:
parent
2bac7fa037
commit
4f6acfa7d9
|
@ -1,8 +1,7 @@
|
|||
|
||||
## Sonoff-Tasmota
|
||||
Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE.
|
||||
|
||||
Current version is **5.7.0** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||
Current version is **5.7.0a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||
|
||||
### ATTENTION All versions
|
||||
|
||||
|
@ -60,4 +59,4 @@ The following devices are supported:
|
|||
|
||||
### License
|
||||
|
||||
This program is licensed under GPL-3.0
|
||||
This program is licensed under GPL-3.0
|
|
@ -1,4 +1,9 @@
|
|||
/* 5.7.0 20170907
|
||||
/* 5.7.0a
|
||||
* Remove leading spaces from MQTT data
|
||||
* Fix webconsole special character entry
|
||||
* Allow # as prefix for color value
|
||||
*
|
||||
* 5.7.0 20170907
|
||||
* Shrink module configuration webpage
|
||||
* Fix settings order during startup to allow for displaying debug messages
|
||||
* Fix some string length issues
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||
====================================================*/
|
||||
|
||||
#define VERSION 0x05070000 // 5.7.0
|
||||
#define VERSION 0x05070001 // 5.7.0a
|
||||
|
||||
enum log_t {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE, LOG_LEVEL_ALL};
|
||||
enum week_t {Last, First, Second, Third, Fourth};
|
||||
|
@ -890,7 +890,13 @@ void mqttDataCb(char* topic, byte* data, unsigned int data_len)
|
|||
uint32_t address;
|
||||
|
||||
strncpy(topicBuf, topic, sizeof(topicBuf));
|
||||
memcpy(dataBuf, data, sizeof(dataBuf));
|
||||
for (i = 0; i < data_len; i++) {
|
||||
if (!isspace(data[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
data_len -= i;
|
||||
memcpy(dataBuf, data +i, sizeof(dataBuf));
|
||||
dataBuf[sizeof(dataBuf)-1] = 0;
|
||||
|
||||
snprintf_P(svalue, sizeof(svalue), PSTR(D_LOG_RESULT D_RECEIVED_TOPIC " %s, " D_DATA_SIZE " %d, " D_DATA " %s"),
|
||||
|
|
|
@ -102,7 +102,7 @@ const char HTTP_SCRIPT_CONSOL[] PROGMEM =
|
|||
"t=document.getElementById('t1');"
|
||||
"if(p==1){"
|
||||
"c=document.getElementById('c1');"
|
||||
"o='&c1='+encodeURI(c.value);"
|
||||
"o='&c1='+encodeURIComponent(c.value);"
|
||||
"c.value='';"
|
||||
"t.scrollTop=sn;"
|
||||
"}"
|
||||
|
|
|
@ -479,6 +479,10 @@ boolean sl_command(char *type, uint16_t index, char *dataBufUc, uint16_t data_le
|
|||
char *p;
|
||||
|
||||
if ((sfl_flg > 1) && !strcasecmp_P(type, PSTR(D_CMND_COLOR))) {
|
||||
if (dataBufUc[0] == '#') {
|
||||
dataBufUc++;
|
||||
data_len--;
|
||||
}
|
||||
if ((2 * sfl_flg) == data_len) {
|
||||
for (byte i = 0; i < sfl_flg; i++) {
|
||||
strlcpy(scolor, dataBufUc + (i *2), 3);
|
||||
|
|
Loading…
Reference in New Issue