From 4206725e6df038be79ac36e942b1bffcf6a2c0ae Mon Sep 17 00:00:00 2001 From: starcalc Date: Sun, 8 Apr 2018 20:14:38 +0200 Subject: [PATCH] Zeus: Mimimi (Timeout-Logik beim Disco-Modus umgestellt) --- data/homie/config.json | 16 ++++++++++++++++ esp-deckenlicht.ino | 6 +++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 data/homie/config.json diff --git a/data/homie/config.json b/data/homie/config.json new file mode 100644 index 0000000..7abfcb0 --- /dev/null +++ b/data/homie/config.json @@ -0,0 +1,16 @@ +{ +"name": "esp-deckenlicht", +"device_id": "esp-deckenlicht", +"wifi": { +"ssid": "CTDO-IoT", +"password": "12345678" +}, +"mqtt": { +"host": "raum.ctdo.de", +"port": 1883, +"auth": false +}, +"ota": { +"enabled": false +} +} diff --git a/esp-deckenlicht.ino b/esp-deckenlicht.ino index 704acb1..bc5685f 100644 --- a/esp-deckenlicht.ino +++ b/esp-deckenlicht.ino @@ -11,10 +11,10 @@ #define LOWER 50 #define MINIMUM 1 #define OFF 0 -int timeout = 50; +int timeout = (1000-50); #define FW_NAME "esp-deckenlicht" -#define FW_VERSION "1.0.0" +#define FW_VERSION "1.0.1" int w0; int w1; int w2; @@ -198,7 +198,7 @@ void loopHandler() { if (disco) { - if (millis() - lastEvent >= timeout || lastEvent == 0) { + if (millis() - lastEvent >= (1000-timeout) || lastEvent == 0) { lastEvent = millis(); if (step >= 4) { step = 0;