From 8b7645b05d24eadb1ec2b7bb5d99a5e383faaed6 Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sat, 30 Jun 2018 19:09:48 +0200 Subject: [PATCH] Quick fix to re-instate iFan02 RC Quick fix to re-instate iFan02 RC --- sonoff/sonoff.ino | 7 ++++--- sonoff/xdrv_02_webserver.ino | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 16b448e68..6cd62ec56 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -97,8 +97,8 @@ const char kTasmotaCommands[] PROGMEM = D_CMND_I2CSCAN "|" D_CMND_SERIALSEND "|" D_CMND_BAUDRATE "|" D_CMND_SERIALDELIMITER; //const uint8_t kIFan02Speed[4][3] = {{0,0,0}, {1,0,0}, {1,1,0}, {1,0,1}}; -//const uint8_t kIFan02Speed[4][3] = {{6,6,6}, {7,6,6}, {7,7,6}, {7,6,7}}; -const uint8_t kIFan02Speed[4][3] = {{16,16,16}, {17,16,16}, {17,17,16}, {17,16,17}}; +const uint8_t kIFan02Speed[4][3] = {{6,6,6}, {7,6,6}, {7,7,6}, {7,6,7}}; +//const uint8_t kIFan02Speed[4][3] = {{16,16,16}, {17,16,16}, {17,17,16}, {17,16,17}}; // Global variables unsigned long feature_drv1; // Compiled driver feature map @@ -1207,6 +1207,7 @@ void ExecuteCommandPower(byte device, byte state, int source) // ShowSource(source); +/* if (SONOFF_IFAN02 == Settings.module) { if (state > 15) { // Only allow Fanspeed control over relay 2..4 state -= 10; @@ -1219,7 +1220,7 @@ void ExecuteCommandPower(byte device, byte state, int source) device = 1; // Only allow user control over light } } - +*/ uint8_t publish_power = 1; if ((POWER_OFF_NO_STATE == state) || (POWER_ON_NO_STATE == state)) { state &= 1; diff --git a/sonoff/xdrv_02_webserver.ino b/sonoff/xdrv_02_webserver.ino index 6066ff486..c9f3df134 100644 --- a/sonoff/xdrv_02_webserver.ino +++ b/sonoff/xdrv_02_webserver.ino @@ -592,7 +592,11 @@ void HandleAjaxStatusRefresh() WebGetArg("o", tmp, sizeof(tmp)); if (strlen(tmp)) { ShowWebSource(SRC_WEBGUI); - ExecuteCommandPower(atoi(tmp), POWER_TOGGLE, SRC_IGNORE); + if (SONOFF_IFAN02 == Settings.module) { // QandD + ExecuteCommandPower(1, POWER_TOGGLE, SRC_IGNORE); + } else { + ExecuteCommandPower(atoi(tmp), POWER_TOGGLE, SRC_IGNORE); + } } WebGetArg("d", tmp, sizeof(tmp)); if (strlen(tmp)) {