diff --git a/platformio_tasmota_cenv_sample.ini b/platformio_tasmota_cenv_sample.ini index e6cca8334..b3344dedb 100644 --- a/platformio_tasmota_cenv_sample.ini +++ b/platformio_tasmota_cenv_sample.ini @@ -12,7 +12,7 @@ build_flags = ${common.build_flags} [core_stage] ; *** Esp8266 core for Arduino version stage -platform_packages = framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git +platform_packages = framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino/releases/download/3.0.0/esp8266-3.0.0.zip ; *** Use Xtensa build chain 10.2. GNU23 from https://github.com/earlephilhower/esp-quick-toolchain tasmota/toolchain-xtensa @ 5.100200.210303 build_unflags = ${esp_defaults.build_unflags} diff --git a/tasmota/displaydesc/Lanbon_L8_display.ini b/tasmota/displaydesc/Lanbon_L8_display.ini new file mode 100644 index 000000000..23ffc0f07 --- /dev/null +++ b/tasmota/displaydesc/Lanbon_L8_display.ini @@ -0,0 +1,22 @@ +:H,ST7789,240,320,16,SPI,1,22,19,23,21,5,18,25,40 +:S,2,1,3,0,80,30 +:I +01,A0 +11,A0 +3A,81,55 +36,81,00 +21,80 +13,80 +29,A0 +:o,28 +:O,29 +:A,2A,2B,2C +:B,60,1 +:R,36 +:0,C0,00,00,00 +:1,A0,00,00,01 +:2,00,00,00,02 +:3,60,00,00,03 +:i,20,21 +:TI1,38,0,4 +# diff --git a/tasmota/support.ino b/tasmota/support.ino index 5f8c123fd..a65392ca9 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -535,6 +535,24 @@ char* Trim(char* p) return p; } +String HexToString(uint8_t* data, uint32_t length) { + if (!data || !length) { return ""; } + + uint32_t len = (length < 16) ? length : 16; + char hex_data[32]; + ToHex_P((const unsigned char*)data, len, hex_data, sizeof(hex_data)); + String result = hex_data; + result += F(" ["); + for (uint32_t i = 0; i < len; i++) { + result += (isprint(data[i])) ? (char)data[i] : ' '; + } + result += F("]"); + if (length > len) { + result += F(" ..."); + } + return result; +} + String UrlEncode(const String& text) { const char hex[] = "0123456789ABCDEF"; @@ -567,25 +585,6 @@ String UrlEncode(const String& text) { return encoded; } -/* -char* RemoveAllSpaces(char* p) -{ - // remove any white space from the base64 - char *cursor = p; - uint32_t offset = 0; - while (1) { - *cursor = *(cursor + offset); - if ((' ' == *cursor) || ('\t' == *cursor) || ('\n' == *cursor)) { // if space found, remove this char until end of string - offset++; - } else { - if (0 == *cursor) { break; } - cursor++; - } - } - return p; -} -*/ - char* NoAlNumToUnderscore(char* dest, const char* source) { char* write = dest; @@ -2405,9 +2404,6 @@ void AddLogSpi(bool hardware, uint32_t clk, uint32_t mosi, uint32_t miso) { } } - - - /*********************************************************************************************\ * Uncompress static PROGMEM strings \*********************************************************************************************/ diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 3e26a98d3..c26c6fd3c 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -241,7 +241,7 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len) } AddLog_P(LOG_LEVEL_DEBUG, PSTR("CMD: " D_GROUP " %d, " D_INDEX " %d, " D_COMMAND " \"%s\", " D_DATA " \"%s\""), - grpflg, index, type, (binary_data) ? PSTR("Binary") : dataBuf); + grpflg, index, type, (binary_data) ? HexToString((uint8_t*)dataBuf, data_len).c_str() : dataBuf); if (type != nullptr) { Response_P(PSTR("{\"" D_JSON_COMMAND "\":\"" D_JSON_ERROR "\"}")); @@ -642,10 +642,6 @@ void CmndStatus(void) } #endif -#ifdef USE_SCRIPT_STATUS - if (bitRead(Settings.rule_enabled, 0)) { Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data); } -#endif - ResponseClear(); } diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 77a40dbb7..b773a264d 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -8410,7 +8410,15 @@ bool Xdrv10(uint8_t function) break; case FUNC_RULES_PROCESS: if (bitRead(Settings.rule_enabled, 0)) { +#ifdef USE_SCRIPT_STATUS + if (!strncmp_P(TasmotaGlobal.mqtt_data, PSTR("{\"Status"), 8)) { + Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data); + } else { + Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); + } +#else Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); +#endif result = glob_script_mem.event_handeled; } break;