Merge pull request #236 from biveraxe/ver4dev

Корректировка комментариев и улучшаем Uart для Nextion
This commit is contained in:
2022-11-13 21:02:17 +05:00
committed by GitHub
2 changed files with 14 additions and 8 deletions

View File

@@ -13,7 +13,11 @@
# python PrepareProject.py --profile <ИмяФайла>
# python PrepareProject.py -p <ИмяФайла>
#
#
# поддерживаемые контроллеры (профили):
# esp8266_4mb
# esp32_4mb
# esp8266_1mb
# esp8266_1mb_ota
import configparser
import os, json, sys, getopt

View File

@@ -106,15 +106,17 @@ class UART : public IoTItem {
case 2: // формат событий для Nextion ID=Value0xFF0xFF0xFF
printStr += eventItem->getID();
if (printStr.indexOf("_") == -1) return; // пропускаем событие, если нет используемого признака типа данных - _txt или _vol
if (printStr.indexOf("_val") > 0) {
printStr.replace("_val", ".val=");
printStr += eventItem->getValue();
} else if (printStr.indexOf("_txt") > 0) {
printStr.replace("_txt", ".txt=");
printStr += "\"";
if (printStr.indexOf("_txt") > 0) {
printStr.replace("_txt", ".txt=\"");
printStr += eventItem->getValue();
printStr += "\"";
} else return;
} else {
printStr.replace("_", ".");
printStr += "=";
printStr += eventItem->getValue();
}
uartPrintFFF(printStr);
break;
}