This commit is contained in:
Dmitry Borisenko
2020-10-04 02:45:26 +03:00
parent d6cb8b8d9a
commit 1e4206f31d
4 changed files with 23 additions and 56 deletions

View File

@@ -2,7 +2,7 @@
//=================Firmeare=================
#define FIRMWARE_NAME "esp8266-iotm"
#define FIRMWARE_VERSION 247
#define FIRMWARE_VERSION 248
#define FLASH_4MB true
//=================System===================
@@ -25,7 +25,7 @@
//#define WEBSOCKET_ENABLED
//#define LAYOUT_IN_RAM
//#define UDP_ENABLED
//#define SSDP_EN
#define SSDP_EN
//=========Sensors enable/disable===========
#define TANK_LEVEL_SAMPLES 10

View File

@@ -1,5 +1,6 @@
#pragma once
#include <Arduino.h>
#include "Class/LineParsing.h"
#include "Global.h"
@@ -26,18 +27,19 @@ class ButtonInClass : public LineParsing {
if (but[switch_number]) {
buttons[switch_number].update();
if (buttons[switch_number].fell()) {
}
if (buttons[switch_number].rose()) {
String key = jsonReadStr(configOptionJson, "switch_num_" + String(switch_number));
state = !state;
switchChangeVirtual(key, String(state));
}
if (buttons[switch_number].rose()) {
}
}
switch_number++;
if (switch_number == NUM_BUTTONS) {
switch_number = 0;
}
}
void switchStateSetDefault() {
if (_state != "") {
switchChangeVirtual(_key, _state);
@@ -47,7 +49,7 @@ class ButtonInClass : public LineParsing {
void switchChangeVirtual(String key, String state) {
eventGen(key, "");
jsonWriteInt(configLiveJson, key, state.toInt());
publishStatus(key, state);
publishStatus(key, state);
}
};