added espasyncota lib

This commit is contained in:
2021-08-06 15:50:44 +02:00
parent 42bac7c293
commit 76ef403bbf
19 changed files with 311 additions and 124 deletions
+6 -3
View File
@@ -41,9 +41,11 @@ void update_switch()
const auto newState = readSwitch();
if (newState == switchState.load())
switchDebounce = 0;
else {
else
{
switchDebounce++;
if (switchDebounce >= 10) {
if (switchDebounce >= 10)
{
switchDebounce = 0;
switchState = newState;
@@ -51,7 +53,8 @@ void update_switch()
if (mqttConnected)
mqttVerbosePub(config::topic_switch_status.value(), switchState ? "ON" : "OFF", 0, 1);
if (config::enable_lamp.value()) {
if (config::enable_lamp.value())
{
lampState = !lampState;
writeLamp(lampState);