diff --git a/README.md b/README.md index a8e04b635..990ebeda3 100644 --- a/README.md +++ b/README.md @@ -1,7 +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.0a** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.7.0b** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### ATTENTION All versions diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 75fc205f8..176455011 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,8 @@ -/* 5.7.0a +/* 5.7.0b + * Add snfled UNDOCA + * Allow # as prefix for color value for ws2812 too + * + * 5.7.0a * Remove leading spaces from MQTT data * Fix webconsole special character entry * Allow # as prefix for color value diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 15e177344..7618a932c 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x05070001 // 5.7.0a +#define VERSION 0x05070002 // 5.7.0b 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}; diff --git a/sonoff/xdrv_snfled.ino b/sonoff/xdrv_snfled.ino index 28ecb98c4..90e5e1a77 100644 --- a/sonoff/xdrv_snfled.ino +++ b/sonoff/xdrv_snfled.ino @@ -555,6 +555,14 @@ boolean sl_command(char *type, uint16_t index, char *dataBufUc, uint16_t data_le do_cmnd_power(1, 1); snprintf_P(svalue, ssvalue, PSTR("{\"" D_CMND_WAKEUP "\":\"" D_STARTED "\"}")); } + else if (!strcasecmp_P(type, PSTR("UNDOCA"))) { // Theos legacy status + sl_getColor(scolor); + scolor[6] = '\0'; // RGB only + snprintf_P(svalue, ssvalue, PSTR("%s, %d, %d, 1, %d, 1"), + scolor, sysCfg.led_fade, sysCfg.led_table, sysCfg.led_speed); + mqtt_publish_topic_P(1, type, svalue); + svalue[0] = '\0'; + } else { serviced = false; // Unknown command } diff --git a/sonoff/xdrv_ws2812.ino b/sonoff/xdrv_ws2812.ino index 83ad693ec..39d181186 100644 --- a/sonoff/xdrv_ws2812.ino +++ b/sonoff/xdrv_ws2812.ino @@ -530,6 +530,10 @@ boolean ws2812_command(char *type, uint16_t index, char *dataBuf, uint16_t data_ ws2812_getColor(index, svalue, ssvalue); } else if (!strcasecmp_P(type, PSTR(D_CMND_COLOR))) { + if (dataBuf[0] == '#') { + dataBuf++; + data_len--; + } if (6 == data_len) { ws2812_setColor(0, dataBuf); bitSet(power, ws_bit); @@ -606,10 +610,8 @@ boolean ws2812_command(char *type, uint16_t index, char *dataBuf, uint16_t data_ } snprintf_P(svalue, ssvalue, PSTR("{\"" D_CMND_SCHEME "\":%d}"), sysCfg.ws_scheme); } - else if (!strcmp_P(type,PSTR("UNDOCA"))) { // Theos WS2812 legacy status + else if (!strcasecmp_P(type, PSTR("UNDOCA"))) { // Theos legacy status RgbColor mcolor; - char mtopic[TOPSZ]; - getTopic_P(mtopic, 1, sysCfg.mqtt_topic, type); ws2812_setDim(sysCfg.ws_dimmer); mcolor = dcolor; uint32_t color = (uint32_t)mcolor.R << 16; @@ -617,7 +619,7 @@ boolean ws2812_command(char *type, uint16_t index, char *dataBuf, uint16_t data_ color += (uint32_t)mcolor.B; snprintf_P(svalue, ssvalue, PSTR("%06X, %d, %d, %d, %d, %d"), color, sysCfg.ws_fade, sysCfg.ws_ledtable, sysCfg.ws_scheme, sysCfg.ws_speed, sysCfg.ws_width); - mqtt_publish(mtopic, svalue); + mqtt_publish_topic_P(1, type, svalue); svalue[0] = '\0'; } else {