mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
@@ -260,7 +260,7 @@ void publishState() {
|
||||
String state = selectToMarkerLast(tmp, ":");
|
||||
state.replace("\"", "");
|
||||
|
||||
if (topic != "name" && topic != "lang" && topic != "ip" && topic.indexOf("_in") < 0) {
|
||||
if ((topic != "time") && (topic != "name") && (topic != "lang") && (topic != "ip") && (topic.indexOf("_in") < 0)) {
|
||||
publishStatus(topic, state);
|
||||
}
|
||||
str = deleteBeforeDelimiter(str, ",");
|
||||
|
||||
@@ -2,10 +2,14 @@
|
||||
|
||||
static const char* MODULE = "Scen";
|
||||
|
||||
boolean isScenarioEnabled() {
|
||||
return jsonReadBool(configSetupJson, "scen") && jsonReadStr(configOptionJson, "scenario_status") != "";
|
||||
}
|
||||
|
||||
void loopScenario() {
|
||||
bool enabled = jsonReadBool(configSetupJson, "scen");
|
||||
if (enabled) {
|
||||
if ((jsonReadStr(configOptionJson, "scenario_status") != "")) {
|
||||
if (!isScenarioEnabled()) {
|
||||
return;
|
||||
}
|
||||
String str = scenario;
|
||||
str += "\n";
|
||||
str.replace("\r\n", "\n");
|
||||
@@ -71,17 +75,17 @@ void loopScenario() {
|
||||
String tmp2 = jsonReadStr(configOptionJson, "scenario_status"); //читаем файл событий
|
||||
tmp2 = deleteBeforeDelimiter(tmp2, ","); //удаляем выполненное событие
|
||||
jsonWriteStr(configOptionJson, "scenario_status", tmp2); //записываем обновленный файл событий
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//событие выглядит как имя плюс set плюс номер: button+Set+1
|
||||
// событие: имя + Set + номер
|
||||
// button+Set+1
|
||||
void eventGen(String event_name, String number) {
|
||||
if (jsonReadStr(configSetupJson, "scen") == "1") {
|
||||
String tmp = jsonReadStr(configOptionJson, "scenario_status"); //генерирование события
|
||||
jsonWriteStr(configOptionJson, "scenario_status", tmp + event_name + number + ",");
|
||||
if (!jsonReadBool(configSetupJson, "scen")) {
|
||||
return;
|
||||
}
|
||||
// генерирование события
|
||||
String tmp = jsonReadStr(configOptionJson, "scenario_status");
|
||||
jsonWriteStr(configOptionJson, "scenario_status", tmp + event_name + number + ",");
|
||||
}
|
||||
|
||||
String add_set(String str) {
|
||||
|
||||
Reference in New Issue
Block a user