new board esp32 3m flash, bugfix modules

This commit is contained in:
Mit4el
2023-10-08 18:19:08 +03:00
parent 0b3289a0ea
commit 164f3be998
86 changed files with 348 additions and 72 deletions

View File

@@ -70,19 +70,19 @@ long IoTItem::getInterval() { return _interval; }
bool IoTItem::isGlobal() { return _global; }
void IoTItem::setValue(const String& valStr, bool genEvent) {
value.isDecimal = isDigitDotCommaStr(valStr);
value.isDecimal = isDigitDotCommaStr(valStr);
if (value.isDecimal) {
value.valD = valStr.toFloat();
getRoundValue();
getRoundValue();
} else {
value.valS = valStr;
value.valS = valStr;
}
setValue(value, genEvent);
}
void IoTItem::setValue(const IoTValue& Value, bool genEvent) {
value = Value;
value = Value;
if (value.isDecimal) {
regEvent(value.valD, "", false, genEvent);
@@ -100,7 +100,7 @@ void IoTItem::sendSubWidgetsValues(String& id, String& json) {
// когда событие случилось
void IoTItem::regEvent(const String& value, const String& consoleInfo, bool error, bool genEvent) {
if (_needSave) {
if (_needSave) {
jsonWriteStr_(valuesFlashJson, _id, value);
needSaveValues = true;
}
@@ -141,7 +141,7 @@ String IoTItem::getRoundValue() {
}
void IoTItem::regEvent(float regvalue, const String& consoleInfo, bool error, bool genEvent) {
value.valD = regvalue;
value.valD = regvalue;
if (_multiply) value.valD = value.valD * _multiply;
if (_plus) value.valD = value.valD + _plus;
@@ -185,6 +185,10 @@ void IoTItem::checkIntFromNet() {
}
}
String IoTItem::getMqttExterSub() {
return "";
}
// хуки для системных событий (должны начинаться с "on")
void IoTItem::onRegEvent(IoTItem* item) {}
void IoTItem::onMqttRecive(String& topic, String& msg) {}