From 869aa4d6fb7e82fe910db8775d9d06de9943b35a Mon Sep 17 00:00:00 2001 From: arendst Date: Wed, 22 Nov 2017 15:34:07 +0100 Subject: [PATCH] v5.9.1h - Add switchmode 7 5.9.1h * Patch library I2Cdevlib-Core for esp8266-core 2.4.0-rc2 * Add option PUSHBUTTON_TOGGLE (SwitchMode 7) to allow toggling on any switch change (#1221) * Fix DHT sensor timeout recognition by distinguish "signal already there" from "timeout" (#1233) --- README.md | 2 +- sonoff/_releasenotes.ino | 7 ++++++- sonoff/sonoff.h | 2 +- sonoff/sonoff.ino | 7 ++++++- sonoff/user_config.h | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7e7bcf854..c38ce223a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## Sonoff-Tasmota Provide ESP8266 based Sonoff by [iTead Studio](https://www.itead.cc/) and ElectroDragon IoT Relay with Serial, Web and MQTT control allowing 'Over the Air' or OTA firmware updates using Arduino IDE. -Current version is **5.9.1g** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. +Current version is **5.9.1h** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information. ### ATTENTION All versions diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 0caf75921..3b650c9ab 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,9 @@ -/* 5.9.1g +/* 5.9.1h + * Patch library I2Cdevlib-Core for esp8266-core 2.4.0-rc2 + * Add option PUSHBUTTON_TOGGLE (SwitchMode 7) to allow toggling on any switch change (#1221) + * Fix DHT sensor timeout recognition by distinguish "signal already there" from "timeout" (#1233) + * + * 5.9.1g * Fix typo ALIRFRCV into ARIRFRCV * Add nicer clock support for larger hand widths * Add better clock support for different pixel counts (#1226) diff --git a/sonoff/sonoff.h b/sonoff/sonoff.h index 40061906e..3880a0fa7 100644 --- a/sonoff/sonoff.h +++ b/sonoff/sonoff.h @@ -111,7 +111,7 @@ enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_D enum WifiConfigOptions {WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT, MAX_WIFI_OPTION}; -enum SwitchModeOptions {TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, MAX_SWITCH_OPTION}; +enum SwitchModeOptions {TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, PUSHBUTTON_TOGGLE, MAX_SWITCH_OPTION}; enum LedStateOptions {LED_OFF, LED_POWER, LED_MQTTSUB, LED_POWER_MQTTSUB, LED_MQTTPUB, LED_POWER_MQTTPUB, LED_MQTT, LED_POWER_MQTT, MAX_LED_OPTION}; diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index edf60a5db..e6490075b 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -25,7 +25,7 @@ - Select IDE Tools - Flash Size: "1M (no SPIFFS)" ====================================================*/ -#define VERSION 0x05090107 // 5.9.1g +#define VERSION 0x05090108 // 5.9.1h // Location specific includes #include "sonoff.h" // Enumaration used in user_config.h @@ -2083,6 +2083,11 @@ void SwitchHandler() switchflag = 2; // Toggle with releasing pushbutton from Gnd } break; + case PUSHBUTTON_TOGGLE: + if (button != lastwallswitch[i]) { + switchflag = 2; // Toggle with any pushbutton change + } + break; case PUSHBUTTONHOLD: if ((PRESSED == button) && (NOT_PRESSED == lastwallswitch[i])) { holdwallswitch[i] = Settings.param[P_HOLD_TIME] * (STATES / 10); diff --git a/sonoff/user_config.h b/sonoff/user_config.h index a8831955e..4e999a72a 100644 --- a/sonoff/user_config.h +++ b/sonoff/user_config.h @@ -151,7 +151,7 @@ #define APP_SLEEP 0 // [Sleep] Sleep time to lower energy consumption (0 = Off, 1 - 250 mSec) #define KEY_HOLD_TIME 40 // [SetOption32] Number of 0.1 seconds to hold Button or external Pushbutton before sending HOLD message -#define SWITCH_MODE TOGGLE // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD or PUSHBUTTONHOLD_INV (the wall switch state) +#define SWITCH_MODE TOGGLE // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV or PUSHBUTTON_TOGGLE (the wall switch state) #define WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with #define TEMP_CONVERSION 0 // [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit)