From a0dcdb59b294332f47703ba359d494345da6b425 Mon Sep 17 00:00:00 2001 From: arendst Date: Sat, 16 Sep 2017 17:38:35 +0200 Subject: [PATCH] v5.7.1h - Additional files 5.7.1h * Consolidate WS2812 (xdrv_ws2812) into Sonoff Led (xdrv_snfled) * Invert WS2812 fade speed to align with Sonoff led (Speed 1 = fast, Speed 8 = slow) * Remove upper case MQTT receive buffer --- sonoff/xdrv_domoticz.ino | 8 -------- sonoff/xdrv_wemohue.ino | 15 --------------- 2 files changed, 23 deletions(-) diff --git a/sonoff/xdrv_domoticz.ino b/sonoff/xdrv_domoticz.ino index a947e81db..ffc1d5a2e 100644 --- a/sonoff/xdrv_domoticz.ino +++ b/sonoff/xdrv_domoticz.ino @@ -58,11 +58,6 @@ void mqtt_publishDomoticzPowerState(byte device) sysCfg.domoticz_relay_idx[device -1], sysCfg.led_dimmer[device -1]); mqtt_publish(domoticz_in_topic); } - else if ((Maxdevice == device) && (pin[GPIO_WS2812] < 99)) { - snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"idx\":%d,\"nvalue\":2,\"svalue\":\"%d\"}"), - sysCfg.domoticz_relay_idx[device -1], sysCfg.ws_dimmer); - mqtt_publish(domoticz_in_topic); - } snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"idx\":%d,\"nvalue\":%d,\"svalue\":\"\"}"), sysCfg.domoticz_relay_idx[device -1], (power & (0x01 << (device -1))) ? 1 : 0); mqtt_publish(domoticz_in_topic); @@ -165,9 +160,6 @@ boolean domoticz_mqttData(char *topicBuf, uint16_t stopicBuf, char *dataBuf, uin snprintf_P(stemp1, sizeof(stemp1), PSTR("%d"), i +1); if (2 == nvalue) { nvalue = domoticz["svalue1"]; - if ((pin[GPIO_WS2812] < 99) && (sysCfg.ws_dimmer == nvalue)) { - return 1; - } if (sfl_flg && (sysCfg.led_dimmer[i] == nvalue)) { return 1; } diff --git a/sonoff/xdrv_wemohue.ino b/sonoff/xdrv_wemohue.ino index 697c9305c..8500f28dc 100755 --- a/sonoff/xdrv_wemohue.ino +++ b/sonoff/xdrv_wemohue.ino @@ -464,11 +464,6 @@ void hue_light_status(byte device, String *response) if (sfl_flg) { sl_replaceHSB(response); -#ifdef USE_WS2812 - } - else if (pin[GPIO_WS2812] < 99) { - ws2812_replaceHSB(response); -#endif // USE_WS2812 } else { response->replace("{h}", "0"); response->replace("{s}", "0"); @@ -579,11 +574,6 @@ void hue_lights(String *path) if (sfl_flg) { sl_getHSB(&hue,&sat,&bri); -#ifdef USE_WS2812 - } - else if (pin[GPIO_WS2812] < 99) { - ws2812_getHSB(&hue,&sat,&bri); -#endif // USE_WS2812 } if (hue_json.containsKey("bri")) { @@ -638,11 +628,6 @@ void hue_lights(String *path) if (change) { if (sfl_flg) { sl_setHSB(hue, sat, bri, ct); -#ifdef USE_WS2812 - } - else if (pin[GPIO_WS2812] < 99) { - ws2812_setHSB(hue, sat, bri); -#endif // USE_WS2812 } change = false; }