From 5e95085a3f4ae9eb569144e92e9a8636aaf0808e Mon Sep 17 00:00:00 2001 From: arendst Date: Tue, 24 Jan 2017 13:44:19 +0100 Subject: [PATCH] v3.2.9 3.2.9 20170124 * Fix compile error when MQTT is disabled (#269) * Change PowerOnState function to only trigger when Power On (and not on restart) (#238) * Add command LedPower On|Off to control main led (#247) * Add charset=utf-8 to webpages (#266) * Update Hue emulation (#268) * Rewrite WS2812 code and prep for 4.0 * Add support for domoticz Dimmer on WS2812 * Add commands SwitchTopic and SwitchRetain On|Off to be used with external switch instead of ButtonTopic and ButtonRetain * Enforce at least IDE 1.6.10 and ESP8266 2.3.0 --- README.md | 2 +- sonoff/_releasenotes.ino | 5 ++++- sonoff/sonoff.ino | 22 +++++++++++++++++----- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9e66d73..1c37101 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## Sonoff-MQTT-OTA-Arduino - 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 **3.2.8** - See ```sonoff/_releasenotes.ino``` for change information. +Current version is **3.2.9** - See ```sonoff/_releasenotes.ino``` for change information. Sonoff See [Wiki](https://github.com/arendst/Sonoff-MQTT-OTA-Arduino/wiki) for more information.
diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 49ba9d8..47723d3 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,4 +1,7 @@ -/* 3.2.8 20170124 +/* 3.2.9 20170124 + * Fix compile error when MQTT is disabled (#269) + * + * 3.2.8 20170124 * Change PowerOnState function to only trigger when Power On (and not on restart) (#238) * Add command LedPower On|Off to control main led (#247) * Add charset=utf-8 to webpages (#266) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 1267cf1..d109c2e 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -10,7 +10,7 @@ * ==================================================== */ -#define VERSION 0x03020800 // 3.2.8 +#define VERSION 0x03020900 // 3.2.9 #define SONOFF 1 // Sonoff, Sonoff RF, Sonoff SV, Sonoff Dual, Sonoff TH, S20 Smart Socket, 4 Channel #define SONOFF_POW 9 // Sonoff Pow @@ -2452,9 +2452,12 @@ void stateloop() if (Maxdevice > 1) { button = digitalRead(KEY2_PIN); if ((button == PRESSED) && (lastbutton2 == NOT_PRESSED)) { +#ifdef USE_MQTT if (mqttClient.connected() && strcmp(sysCfg.button_topic, "0")) { send_button_power(0, 2, 2); // Execute commend via MQTT - } else { + } else +#endif // USE_MQTT + { do_cmnd_power(2, 2); // Execute command internally } } @@ -2466,9 +2469,12 @@ void stateloop() if (Maxdevice > 2) { button = digitalRead(KEY3_PIN); if ((button == PRESSED) && (lastbutton3 == NOT_PRESSED)) { +#ifdef USE_MQTT if (mqttClient.connected() && strcmp(sysCfg.button_topic, "0")) { send_button_power(0, 3, 2); // Execute commend via MQTT - } else { + } else +#endif // USE_MQTT + { do_cmnd_power(3, 2); // Execute command internally } } @@ -2480,9 +2486,12 @@ void stateloop() if (Maxdevice > 3) { button = digitalRead(KEY4_PIN); if ((button == PRESSED) && (lastbutton4 == NOT_PRESSED)) { +#ifdef USE_MQTT if (mqttClient.connected() && strcmp(sysCfg.button_topic, "0")) { send_button_power(0, 4, 2); // Execute commend via MQTT - } else { + } else +#endif // USE_MQTT + { do_cmnd_power(4, 2); // Execute command internally } } @@ -2511,9 +2520,12 @@ void stateloop() if ((button == NOT_PRESSED) && (lastwallswitch == PRESSED)) switchflag = 2; // Toggle with releasing pushbutton from Gnd } if (switchflag < 3) { +#ifdef USE_MQTT if (mqttClient.connected() && strcmp(sysCfg.switch_topic,"0")) { send_button_power(1, 1, switchflag); // Execute commend via MQTT - } else { + } else +#endif // USE_MQTT + { do_cmnd_power(1, switchflag); // Execute command internally } }