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)
This commit is contained in:
arendst 2017-11-22 15:34:07 +01:00
parent 53b100fdeb
commit 869aa4d6fb
5 changed files with 15 additions and 5 deletions

View File

@ -1,7 +1,7 @@
## Sonoff-Tasmota ## 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. 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 ### ATTENTION All versions

View File

@ -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 * Fix typo ALIRFRCV into ARIRFRCV
* Add nicer clock support for larger hand widths * Add nicer clock support for larger hand widths
* Add better clock support for different pixel counts (#1226) * Add better clock support for different pixel counts (#1226)

View File

@ -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 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}; enum LedStateOptions {LED_OFF, LED_POWER, LED_MQTTSUB, LED_POWER_MQTTSUB, LED_MQTTPUB, LED_POWER_MQTTPUB, LED_MQTT, LED_POWER_MQTT, MAX_LED_OPTION};

View File

@ -25,7 +25,7 @@
- Select IDE Tools - Flash Size: "1M (no SPIFFS)" - Select IDE Tools - Flash Size: "1M (no SPIFFS)"
====================================================*/ ====================================================*/
#define VERSION 0x05090107 // 5.9.1g #define VERSION 0x05090108 // 5.9.1h
// Location specific includes // Location specific includes
#include "sonoff.h" // Enumaration used in user_config.h #include "sonoff.h" // Enumaration used in user_config.h
@ -2083,6 +2083,11 @@ void SwitchHandler()
switchflag = 2; // Toggle with releasing pushbutton from Gnd switchflag = 2; // Toggle with releasing pushbutton from Gnd
} }
break; break;
case PUSHBUTTON_TOGGLE:
if (button != lastwallswitch[i]) {
switchflag = 2; // Toggle with any pushbutton change
}
break;
case PUSHBUTTONHOLD: case PUSHBUTTONHOLD:
if ((PRESSED == button) && (NOT_PRESSED == lastwallswitch[i])) { if ((PRESSED == button) && (NOT_PRESSED == lastwallswitch[i])) {
holdwallswitch[i] = Settings.param[P_HOLD_TIME] * (STATES / 10); holdwallswitch[i] = Settings.param[P_HOLD_TIME] * (STATES / 10);

View File

@ -151,7 +151,7 @@
#define APP_SLEEP 0 // [Sleep] Sleep time to lower energy consumption (0 = Off, 1 - 250 mSec) #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 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 WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with
#define TEMP_CONVERSION 0 // [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit) #define TEMP_CONVERSION 0 // [SetOption8] Return temperature in (0 = Celsius or 1 = Fahrenheit)