mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-27 12:46:34 +00:00
v5.9.1d - Add Arilux LC11 support
5.9.1d * Add support for Arilux LC11 (CLearing RF home code when selecting no Arilux module) * Add fixed color options 1..12 to command Color * Add + (plus) and - (minus) to commands Dimmer (+10/-10), Speed and Scheme
This commit is contained in:
parent
39d30328e4
commit
db4a3a4a1e
@ -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.1c** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
Current version is **5.9.1d** - See [sonoff/_releasenotes.ino](https://github.com/arendst/Sonoff-Tasmota/blob/development/sonoff/_releasenotes.ino) for change information.
|
||||||
|
|
||||||
### ATTENTION All versions
|
### ATTENTION All versions
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
/* 5.9.1c
|
/* 5.9.1d
|
||||||
|
* Add support for Arilux LC11 (CLearing RF home code when selecting no Arilux module)
|
||||||
|
* Add fixed color options 1..12 to command Color
|
||||||
|
* Add + (plus) and - (minus) to commands Dimmer (+10/-10), Speed and Scheme
|
||||||
|
*
|
||||||
|
* 5.9.1c
|
||||||
* Add support for WS2812 RGBW ledstrips to be enabled in user_config.h with define USE_WS2812_CTYPE (#1156)
|
* Add support for WS2812 RGBW ledstrips to be enabled in user_config.h with define USE_WS2812_CTYPE (#1156)
|
||||||
*
|
*
|
||||||
* 5.9.1b
|
* 5.9.1b
|
||||||
|
@ -491,27 +491,29 @@
|
|||||||
#define D_UNIT_WATTHOUR "Wh"
|
#define D_UNIT_WATTHOUR "Wh"
|
||||||
|
|
||||||
// Log message prefix
|
// Log message prefix
|
||||||
#define D_LOG_APPLICATION "APP: "
|
#define D_LOG_APPLICATION "APP: " // Application
|
||||||
#define D_LOG_BRIDGE "BRG: "
|
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||||
#define D_LOG_CONFIG "CFG: "
|
#define D_LOG_CONFIG "CFG: " // Settings
|
||||||
#define D_LOG_COMMAND "CMD: "
|
#define D_LOG_COMMAND "CMD: " // Command
|
||||||
#define D_LOG_DHT "DHT: "
|
#define D_LOG_DEBUG "DBG: " // Debug
|
||||||
#define D_LOG_DOMOTICZ "DOM: "
|
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||||
#define D_LOG_DSB "DSB: "
|
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||||
#define D_LOG_HTTP "HTP: "
|
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||||
#define D_LOG_I2C "I2C: "
|
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||||
#define D_LOG_IRR "IRR: "
|
#define D_LOG_I2C "I2C: " // I2C
|
||||||
#define D_LOG_LOG "LOG: "
|
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||||
#define D_LOG_MODULE "MOD: "
|
#define D_LOG_LOG "LOG: " // Logging
|
||||||
#define D_LOG_MDNS "DNS: "
|
#define D_LOG_MODULE "MOD: " // Module
|
||||||
#define D_LOG_MQTT "MQT: "
|
#define D_LOG_MDNS "DNS: " // mDNS
|
||||||
#define D_LOG_OTHER "OTH: "
|
#define D_LOG_MQTT "MQT: " // MQTT
|
||||||
#define D_LOG_RESULT "RSL: "
|
#define D_LOG_OTHER "OTH: " // Other
|
||||||
#define D_LOG_SERIAL "SER: "
|
#define D_LOG_RESULT "RSL: " // Result
|
||||||
#define D_LOG_SHT1 "SHT: "
|
#define D_LOG_RFR "RFR: " // RF Received
|
||||||
#define D_LOG_UPLOAD "UPL: "
|
#define D_LOG_SERIAL "SER: " // Serial
|
||||||
#define D_LOG_UPNP "UPP: "
|
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||||
#define D_LOG_WIFI "WIF: "
|
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||||
|
#define D_LOG_UPNP "UPP: " // UPnP
|
||||||
|
#define D_LOG_WIFI "WIF: " // Wifi
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
#define D_RSLT_RESULT "ERGEBNIS"
|
#define D_RSLT_RESULT "ERGEBNIS"
|
||||||
|
@ -491,27 +491,29 @@
|
|||||||
#define D_UNIT_WATTHOUR "Wh"
|
#define D_UNIT_WATTHOUR "Wh"
|
||||||
|
|
||||||
// Log message prefix
|
// Log message prefix
|
||||||
#define D_LOG_APPLICATION "APP: "
|
#define D_LOG_APPLICATION "APP: " // Application
|
||||||
#define D_LOG_BRIDGE "BRG: "
|
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||||
#define D_LOG_CONFIG "CFG: "
|
#define D_LOG_CONFIG "CFG: " // Settings
|
||||||
#define D_LOG_COMMAND "CMD: "
|
#define D_LOG_COMMAND "CMD: " // Command
|
||||||
#define D_LOG_DHT "DHT: "
|
#define D_LOG_DEBUG "DBG: " // Debug
|
||||||
#define D_LOG_DOMOTICZ "DOM: "
|
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||||
#define D_LOG_DSB "DSB: "
|
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||||
#define D_LOG_HTTP "HTP: "
|
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||||
#define D_LOG_I2C "I2C: "
|
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||||
#define D_LOG_IRR "IRR: "
|
#define D_LOG_I2C "I2C: " // I2C
|
||||||
#define D_LOG_LOG "LOG: "
|
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||||
#define D_LOG_MODULE "MOD: "
|
#define D_LOG_LOG "LOG: " // Logging
|
||||||
#define D_LOG_MDNS "DNS: "
|
#define D_LOG_MODULE "MOD: " // Module
|
||||||
#define D_LOG_MQTT "MQT: "
|
#define D_LOG_MDNS "DNS: " // mDNS
|
||||||
#define D_LOG_OTHER "OTH: "
|
#define D_LOG_MQTT "MQT: " // MQTT
|
||||||
#define D_LOG_RESULT "RSL: "
|
#define D_LOG_OTHER "OTH: " // Other
|
||||||
#define D_LOG_SERIAL "SER: "
|
#define D_LOG_RESULT "RSL: " // Result
|
||||||
#define D_LOG_SHT1 "SHT: "
|
#define D_LOG_RFR "RFR: " // RF Received
|
||||||
#define D_LOG_UPLOAD "UPL: "
|
#define D_LOG_SERIAL "SER: " // Serial
|
||||||
#define D_LOG_UPNP "UPP: "
|
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||||
#define D_LOG_WIFI "WIF: "
|
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||||
|
#define D_LOG_UPNP "UPP: " // UPnP
|
||||||
|
#define D_LOG_WIFI "WIF: " // Wifi
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
#define D_RSLT_RESULT "RESULT"
|
#define D_RSLT_RESULT "RESULT"
|
||||||
|
@ -491,27 +491,29 @@
|
|||||||
#define D_UNIT_WATTHOUR "Wh"
|
#define D_UNIT_WATTHOUR "Wh"
|
||||||
|
|
||||||
// Log message prefix
|
// Log message prefix
|
||||||
#define D_LOG_APPLICATION "APP: "
|
#define D_LOG_APPLICATION "APP: " // Application
|
||||||
#define D_LOG_BRIDGE "BRG: "
|
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||||
#define D_LOG_CONFIG "CFG: "
|
#define D_LOG_CONFIG "CFG: " // Settings
|
||||||
#define D_LOG_COMMAND "CMD: "
|
#define D_LOG_COMMAND "CMD: " // Command
|
||||||
#define D_LOG_DHT "DHT: "
|
#define D_LOG_DEBUG "DBG: " // Debug
|
||||||
#define D_LOG_DOMOTICZ "DOM: "
|
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||||
#define D_LOG_DSB "DSB: "
|
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||||
#define D_LOG_HTTP "HTP: "
|
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||||
#define D_LOG_I2C "I2C: "
|
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||||
#define D_LOG_IRR "IRR: "
|
#define D_LOG_I2C "I2C: " // I2C
|
||||||
#define D_LOG_LOG "LOG: "
|
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||||
#define D_LOG_MODULE "MOD: "
|
#define D_LOG_LOG "LOG: " // Logging
|
||||||
#define D_LOG_MDNS "DNS: "
|
#define D_LOG_MODULE "MOD: " // Module
|
||||||
#define D_LOG_MQTT "MQT: "
|
#define D_LOG_MDNS "DNS: " // mDNS
|
||||||
#define D_LOG_OTHER "OTH: "
|
#define D_LOG_MQTT "MQT: " // MQTT
|
||||||
#define D_LOG_RESULT "RSL: "
|
#define D_LOG_OTHER "OTH: " // Other
|
||||||
#define D_LOG_SERIAL "SER: "
|
#define D_LOG_RESULT "RSL: " // Result
|
||||||
#define D_LOG_SHT1 "SHT: "
|
#define D_LOG_RFR "RFR: " // RF Received
|
||||||
#define D_LOG_UPLOAD "UPL: "
|
#define D_LOG_SERIAL "SER: " // Serial
|
||||||
#define D_LOG_UPNP "UPP: "
|
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||||
#define D_LOG_WIFI "WIF: "
|
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||||
|
#define D_LOG_UPNP "UPP: " // UPnP
|
||||||
|
#define D_LOG_WIFI "WIF: " // Wifi
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
#define D_RSLT_RESULT "RESULTAAT"
|
#define D_RSLT_RESULT "RESULTAAT"
|
||||||
|
@ -491,27 +491,29 @@
|
|||||||
#define D_UNIT_WATTHOUR "Wh"
|
#define D_UNIT_WATTHOUR "Wh"
|
||||||
|
|
||||||
// Log message prefix
|
// Log message prefix
|
||||||
#define D_LOG_APPLICATION "APP: "
|
#define D_LOG_APPLICATION "APP: " // Application
|
||||||
#define D_LOG_BRIDGE "BRG: "
|
#define D_LOG_BRIDGE "BRG: " // Bridge
|
||||||
#define D_LOG_CONFIG "CFG: "
|
#define D_LOG_CONFIG "CFG: " // Settings
|
||||||
#define D_LOG_COMMAND "CMD: "
|
#define D_LOG_COMMAND "CMD: " // Command
|
||||||
#define D_LOG_DHT "DHT: "
|
#define D_LOG_DEBUG "DBG: " // Debug
|
||||||
#define D_LOG_DOMOTICZ "DOM: "
|
#define D_LOG_DHT "DHT: " // DHT sensor
|
||||||
#define D_LOG_DSB "DSB: "
|
#define D_LOG_DOMOTICZ "DOM: " // Domoticz
|
||||||
#define D_LOG_HTTP "HTP: "
|
#define D_LOG_DSB "DSB: " // DS18xB20 sensor
|
||||||
#define D_LOG_I2C "I2C: "
|
#define D_LOG_HTTP "HTP: " // HTTP webserver
|
||||||
#define D_LOG_IRR "IRR: "
|
#define D_LOG_I2C "I2C: " // I2C
|
||||||
#define D_LOG_LOG "LOG: "
|
#define D_LOG_IRR "IRR: " // Infra Red Received
|
||||||
#define D_LOG_MODULE "MOD: "
|
#define D_LOG_LOG "LOG: " // Logging
|
||||||
#define D_LOG_MDNS "DNS: "
|
#define D_LOG_MODULE "MOD: " // Module
|
||||||
#define D_LOG_MQTT "MQT: "
|
#define D_LOG_MDNS "DNS: " // mDNS
|
||||||
#define D_LOG_OTHER "OTH: "
|
#define D_LOG_MQTT "MQT: " // MQTT
|
||||||
#define D_LOG_RESULT "RSL: "
|
#define D_LOG_OTHER "OTH: " // Other
|
||||||
#define D_LOG_SERIAL "SER: "
|
#define D_LOG_RESULT "RSL: " // Result
|
||||||
#define D_LOG_SHT1 "SHT: "
|
#define D_LOG_RFR "RFR: " // RF Received
|
||||||
#define D_LOG_UPLOAD "UPL: "
|
#define D_LOG_SERIAL "SER: " // Serial
|
||||||
#define D_LOG_UPNP "UPP: "
|
#define D_LOG_SHT1 "SHT: " // SHT1x sensor
|
||||||
#define D_LOG_WIFI "WIF: "
|
#define D_LOG_UPLOAD "UPL: " // Upload
|
||||||
|
#define D_LOG_UPNP "UPP: " // UPnP
|
||||||
|
#define D_LOG_WIFI "WIF: " // Wifi
|
||||||
|
|
||||||
// Result
|
// Result
|
||||||
#define D_RSLT_RESULT "REZULTAT"
|
#define D_RSLT_RESULT "REZULTAT"
|
||||||
|
@ -177,8 +177,7 @@ struct SYSCFG {
|
|||||||
uint16_t hlw_mkwhs; // 394 MaxEnergyStart
|
uint16_t hlw_mkwhs; // 394 MaxEnergyStart
|
||||||
uint16_t mqtt_retry; // 396
|
uint16_t mqtt_retry; // 396
|
||||||
uint8_t poweronstate; // 398
|
uint8_t poweronstate; // 398
|
||||||
|
uint8_t last_module; // 399
|
||||||
byte free_399[1]; // 399
|
|
||||||
|
|
||||||
uint16_t blinktime; // 39A
|
uint16_t blinktime; // 39A
|
||||||
uint16_t blinkcount; // 39C
|
uint16_t blinkcount; // 39C
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
- Select IDE Tools - Flash Size: "1M (no SPIFFS)"
|
||||||
====================================================*/
|
====================================================*/
|
||||||
|
|
||||||
#define VERSION 0x05090103 // 5.9.1c
|
#define VERSION 0x05090104 // 5.9.1d
|
||||||
|
|
||||||
// Location specific includes
|
// Location specific includes
|
||||||
#include "sonoff.h" // Enumaration used in user_config.h
|
#include "sonoff.h" // Enumaration used in user_config.h
|
||||||
@ -1087,9 +1087,9 @@ void MqttDataCallback(char* topic, byte* data, unsigned int data_len)
|
|||||||
else if (CMND_MODULE == command_code) {
|
else if (CMND_MODULE == command_code) {
|
||||||
if ((payload > 0) && (payload <= MAXMODULE)) {
|
if ((payload > 0) && (payload <= MAXMODULE)) {
|
||||||
payload--;
|
payload--;
|
||||||
byte new_modflg = (Settings.module != payload);
|
Settings.last_module = Settings.module;
|
||||||
Settings.module = payload;
|
Settings.module = payload;
|
||||||
if (new_modflg) {
|
if (Settings.last_module != payload) {
|
||||||
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
||||||
Settings.my_gp.io[i] = 0;
|
Settings.my_gp.io[i] = 0;
|
||||||
}
|
}
|
||||||
@ -2456,6 +2456,7 @@ void GpioInit()
|
|||||||
|
|
||||||
if (!Settings.module || (Settings.module >= MAXMODULE)) {
|
if (!Settings.module || (Settings.module >= MAXMODULE)) {
|
||||||
Settings.module = MODULE;
|
Settings.module = MODULE;
|
||||||
|
Settings.last_module = MODULE;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy_P(&def_module, &kModules[Settings.module], sizeof(def_module));
|
memcpy_P(&def_module, &kModules[Settings.module], sizeof(def_module));
|
||||||
@ -2545,7 +2546,7 @@ void GpioInit()
|
|||||||
devices_present = 0;
|
devices_present = 0;
|
||||||
baudrate = 19200;
|
baudrate = 19200;
|
||||||
}
|
}
|
||||||
else if ((H801 == Settings.module) || (MAGICHOME == Settings.module) || (ARILUX == Settings.module)) { // PWM RGBCW led
|
else if ((H801 == Settings.module) || (MAGICHOME == Settings.module) || (ARILUX_LC01 == Settings.module) || (ARILUX_LC11 == Settings.module)) { // PWM RGBCW led
|
||||||
if (!Settings.flag.pwm_control) {
|
if (!Settings.flag.pwm_control) {
|
||||||
light_type = LT_BASIC; // Use basic PWM control if SetOption15 = 0
|
light_type = LT_BASIC; // Use basic PWM control if SetOption15 = 0
|
||||||
}
|
}
|
||||||
@ -2761,6 +2762,12 @@ void loop()
|
|||||||
}
|
}
|
||||||
#endif // USE_EMULATION
|
#endif // USE_EMULATION
|
||||||
|
|
||||||
|
#ifdef USE_ARILUX_RF
|
||||||
|
if (pin[GPIO_ALIRFRCV] < 99) {
|
||||||
|
AriluxRfHandler();
|
||||||
|
}
|
||||||
|
#endif // USE_ARILUX_RF
|
||||||
|
|
||||||
if (millis() >= state_loop_timer) {
|
if (millis() >= state_loop_timer) {
|
||||||
StateLoop();
|
StateLoop();
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,7 @@ enum ProgramSelectablePins {
|
|||||||
GPIO_ADC0, // ADC
|
GPIO_ADC0, // ADC
|
||||||
GPIO_DI, // my92x1 PWM input
|
GPIO_DI, // my92x1 PWM input
|
||||||
GPIO_DCKI, // my92x1 CLK input
|
GPIO_DCKI, // my92x1 CLK input
|
||||||
|
GPIO_ALIRFRCV, // AliLux RF Receive input
|
||||||
GPIO_USER, // User configurable
|
GPIO_USER, // User configurable
|
||||||
GPIO_MAX };
|
GPIO_MAX };
|
||||||
|
|
||||||
@ -193,7 +194,8 @@ enum SupportedModules {
|
|||||||
MAGICHOME,
|
MAGICHOME,
|
||||||
LUANIHVIO,
|
LUANIHVIO,
|
||||||
KMC_70011,
|
KMC_70011,
|
||||||
ARILUX,
|
ARILUX_LC01,
|
||||||
|
ARILUX_LC11,
|
||||||
MAXMODULE };
|
MAXMODULE };
|
||||||
|
|
||||||
/********************************************************************************************/
|
/********************************************************************************************/
|
||||||
@ -243,7 +245,8 @@ const uint8_t kNiceList[MAXMODULE] PROGMEM = {
|
|||||||
WION,
|
WION,
|
||||||
H801,
|
H801,
|
||||||
MAGICHOME,
|
MAGICHOME,
|
||||||
ARILUX,
|
ARILUX_LC01,
|
||||||
|
ARILUX_LC11,
|
||||||
HUAFAN_SS,
|
HUAFAN_SS,
|
||||||
KMC_70011,
|
KMC_70011,
|
||||||
AILIGHT,
|
AILIGHT,
|
||||||
@ -731,14 +734,33 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
|
|||||||
0, 0, 0
|
0, 0, 0
|
||||||
},
|
},
|
||||||
{ "Arilux", // Arilux AL-LC01 (ESP8285) - https://www.banggood.com/nl/ARILUX-AL-LC01-Super-Mini-LED-WIFI-Smart-RGB-Controller-For-RGB-LED-Strip-Light-DC-9-12V-p-1058603.html
|
{ "Arilux", // Arilux AL-LC01 (ESP8285) - https://www.banggood.com/nl/ARILUX-AL-LC01-Super-Mini-LED-WIFI-Smart-RGB-Controller-For-RGB-LED-Strip-Light-DC-9-12V-p-1058603.html
|
||||||
0, 0, 0, 0, // (PwmFrequency 1111Hz)
|
// (PwmFrequency 1111Hz)
|
||||||
GPIO_USER, // GPIO04 IR or RF receiver (optional)
|
GPIO_KEY1, // GPIO00 Optional Button
|
||||||
|
0,
|
||||||
|
GPIO_LED2_INV, // GPIO02 RF receiver control
|
||||||
|
0,
|
||||||
|
GPIO_ALIRFRCV, // GPIO04 IR or RF receiver (optional)
|
||||||
GPIO_PWM1, // GPIO05 RGB LED Red
|
GPIO_PWM1, // GPIO05 RGB LED Red
|
||||||
0, 0, 0, 0, 0, 0, // Flash connection
|
0, 0, 0, 0, 0, 0, // Flash connection
|
||||||
GPIO_PWM2, // GPIO12 RGB LED Green
|
GPIO_PWM2, // GPIO12 RGB LED Green
|
||||||
GPIO_PWM3, // GPIO13 RGB LED Blue
|
GPIO_PWM3, // GPIO13 RGB LED Blue
|
||||||
GPIO_USER, // GPIO14 RGBW LED White (optional - set to PWM4 for Cold White or Warm White)
|
GPIO_USER, // GPIO14 RGBW LED White (optional - set to PWM4 for Cold White or Warm White)
|
||||||
0, 0, 0
|
0, 0, 0
|
||||||
|
},
|
||||||
|
{ "Arilux LC11", // Arilux AL-LC11 (ESP8266) - https://www.banggood.com/nl/ARILUX-AL-LC11-Super-Mini-LED-WIFI-APP-Controller-RF-Remote-Control-For-RGBWW-LED-Strip-DC9-28V-p-1085112.html
|
||||||
|
// (PwmFrequency 540Hz)
|
||||||
|
GPIO_KEY1, // GPIO00 Optional Button
|
||||||
|
0,
|
||||||
|
GPIO_LED2_INV, // GPIO02 RF receiver control
|
||||||
|
0,
|
||||||
|
GPIO_PWM2, // GPIO04 RGB LED Green
|
||||||
|
GPIO_PWM1, // GPIO05 RGB LED Red
|
||||||
|
0, 0, 0, 0, 0, 0, // Flash connection
|
||||||
|
GPIO_PWM5, // GPIO12 RGBCW LED Warm
|
||||||
|
GPIO_PWM4, // GPIO13 RGBW LED Cold
|
||||||
|
GPIO_PWM3, // GPIO14 RGB LED Blue
|
||||||
|
GPIO_ALIRFRCV, // GPIO15 RF receiver input
|
||||||
|
0, 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -182,6 +182,8 @@
|
|||||||
#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
|
#define USE_WS2812_CTYPE 1 // WS2812 Color type (0 - RGB, 1 - GRB, 2 - RGBW, 3 - GRBW)
|
||||||
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
|
// #define USE_WS2812_DMA // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow
|
||||||
|
|
||||||
|
#define USE_ARILUX_RF // Add code for Arilux RF remote controller (+0.8k code)
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1!
|
* Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1!
|
||||||
* To be used as step 1 during upgrade.
|
* To be used as step 1 during upgrade.
|
||||||
|
@ -1027,13 +1027,13 @@ snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_LOG D_CMND_SERIALLOG " %d, " D
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
byte new_module = (!strlen(WebServer->arg("g99").c_str())) ? MODULE : atoi(WebServer->arg("g99").c_str());
|
byte new_module = (!strlen(WebServer->arg("g99").c_str())) ? MODULE : atoi(WebServer->arg("g99").c_str());
|
||||||
byte new_modflg = (Settings.module != new_module);
|
Settings.last_module = Settings.module;
|
||||||
Settings.module = new_module;
|
Settings.module = new_module;
|
||||||
mytmplt cmodule;
|
mytmplt cmodule;
|
||||||
memcpy_P(&cmodule, &kModules[Settings.module], sizeof(cmodule));
|
memcpy_P(&cmodule, &kModules[Settings.module], sizeof(cmodule));
|
||||||
String gpios = "";
|
String gpios = "";
|
||||||
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
for (byte i = 0; i < MAX_GPIO_PIN; i++) {
|
||||||
if (new_modflg) {
|
if (Settings.last_module != new_module) {
|
||||||
Settings.my_gp.io[i] = 0;
|
Settings.my_gp.io[i] = 0;
|
||||||
} else {
|
} else {
|
||||||
if (GPIO_USER == cmodule.gp.io[i]) {
|
if (GPIO_USER == cmodule.gp.io[i]) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
xdrv_ir_send.ino - infra red support for Sonoff-Tasmota
|
xdrv_irremote.ino - infra red support for Sonoff-Tasmota
|
||||||
|
|
||||||
Copyright (C) 2017 Heiko Krupp, Lazar Obradovic and Theo Arends
|
Copyright (C) 2017 Heiko Krupp, Lazar Obradovic and Theo Arends
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
xdrv_snfled.ino - PWM, WS2812 and sonoff led support for Sonoff-Tasmota
|
xdrv_light.ino - PWM, WS2812 and sonoff led support for Sonoff-Tasmota
|
||||||
|
|
||||||
Copyright (C) 2017 Theo Arends
|
Copyright (C) 2017 Theo Arends
|
||||||
|
|
||||||
@ -24,9 +24,9 @@
|
|||||||
* ---------- --------- ----- --------- ----------------------------
|
* ---------- --------- ----- --------- ----------------------------
|
||||||
* 1 PWM1 W no (Sonoff BN-SZ)
|
* 1 PWM1 W no (Sonoff BN-SZ)
|
||||||
* 2 PWM2 CW yes (Sonoff Led)
|
* 2 PWM2 CW yes (Sonoff Led)
|
||||||
* 3 PWM3 RGB no (H801, MagicHome and Arilux)
|
* 3 PWM3 RGB no (H801, MagicHome and Arilux LC01)
|
||||||
* 4 PWM4 RGBW no (H801, MagicHome and Arilux)
|
* 4 PWM4 RGBW no (H801, MagicHome and Arilux)
|
||||||
* 5 PWM5 RGBCW yes (H801, Arilux)
|
* 5 PWM5 RGBCW yes (H801, Arilux LC11)
|
||||||
* 9 reserved no
|
* 9 reserved no
|
||||||
* 10 reserved yes
|
* 10 reserved yes
|
||||||
* 11 +WS2812 RGB(W) no (One WS2812 RGB or RGBW ledstrip)
|
* 11 +WS2812 RGB(W) no (One WS2812 RGB or RGBW ledstrip)
|
||||||
@ -58,6 +58,19 @@ const char kLightCommands[] PROGMEM =
|
|||||||
D_CMND_COLOR "|" D_CMND_COLORTEMPERATURE "|" D_CMND_DIMMER "|" D_CMND_LED "|" D_CMND_LEDTABLE "|" D_CMND_FADE "|"
|
D_CMND_COLOR "|" D_CMND_COLORTEMPERATURE "|" D_CMND_DIMMER "|" D_CMND_LED "|" D_CMND_LEDTABLE "|" D_CMND_FADE "|"
|
||||||
D_CMND_PIXELS "|" D_CMND_SCHEME "|" D_CMND_SPEED "|" D_CMND_WAKEUP "|" D_CMND_WAKEUPDURATION "|" D_CMND_WIDTH "|UNDOCA" ;
|
D_CMND_PIXELS "|" D_CMND_SCHEME "|" D_CMND_SPEED "|" D_CMND_WAKEUP "|" D_CMND_WAKEUPDURATION "|" D_CMND_WIDTH "|UNDOCA" ;
|
||||||
|
|
||||||
|
struct LRgbColor {
|
||||||
|
uint8_t R, G, B;
|
||||||
|
};
|
||||||
|
#define MAX_FIXED_COLOR 12
|
||||||
|
const LRgbColor kFixedColor[MAX_FIXED_COLOR] PROGMEM =
|
||||||
|
{ 255,0,0, 0,255,0, 0,0,255, 228,32,0, 0,228,32, 0,32,228, 188,64,0, 0,160,96, 160,32,240, 255,255,0, 255,0,170, 255,255,255 };
|
||||||
|
|
||||||
|
struct LCwColor {
|
||||||
|
uint8_t C, W;
|
||||||
|
};
|
||||||
|
#define MAX_FIXED_COLD_WARM 4
|
||||||
|
const LCwColor kFixedColdWarm[MAX_FIXED_COLD_WARM] PROGMEM = { 0,0, 255,0, 0,255, 128,128 };
|
||||||
|
|
||||||
uint8_t ledTable[] = {
|
uint8_t ledTable[] = {
|
||||||
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
@ -91,6 +104,154 @@ uint16_t light_wakeup_counter = 0;
|
|||||||
|
|
||||||
unsigned long strip_timer_counter = 0; // Bars and Gradient
|
unsigned long strip_timer_counter = 0; // Bars and Gradient
|
||||||
|
|
||||||
|
#ifdef USE_ARILUX_RF
|
||||||
|
/*********************************************************************************************\
|
||||||
|
* Arilux LC11 Rf support stripped from RCSwitch library
|
||||||
|
\*********************************************************************************************/
|
||||||
|
|
||||||
|
#define ARILUX_RF_TIME_AVOID_DUPLICATE 1000 // Milliseconds
|
||||||
|
|
||||||
|
#define ARILUX_RF_MAX_CHANGES 51 // Pulses (sync + 2 x 24 bits)
|
||||||
|
#define ARILUX_RF_SEPARATION_LIMIT 4300 // Microseconds
|
||||||
|
#define ARILUX_RF_RECEIVE_TOLERANCE 60 // Percentage
|
||||||
|
|
||||||
|
unsigned int arilux_rf_timings[ARILUX_RF_MAX_CHANGES];
|
||||||
|
unsigned long arilux_rf_received_value = 0;
|
||||||
|
|
||||||
|
unsigned long arilux_rf_lasttime = 0;
|
||||||
|
unsigned int arilux_rf_change_count = 0;
|
||||||
|
unsigned int arilux_rf_repeat_count = 0;
|
||||||
|
|
||||||
|
unsigned long arilux_rf_last_received_value = 0;
|
||||||
|
unsigned long arilux_rf_last_time = 0;
|
||||||
|
|
||||||
|
uint8_t arilux_rf_toggle = 0;
|
||||||
|
|
||||||
|
#ifndef USE_WS2812_DMA // Collides with Neopixelbus but solves RF misses
|
||||||
|
void AriluxRfInterrupt() ICACHE_RAM_ATTR;
|
||||||
|
#endif // USE_WS2812_DMA
|
||||||
|
|
||||||
|
void AriluxRfInterrupt()
|
||||||
|
{
|
||||||
|
unsigned long time = micros();
|
||||||
|
unsigned int duration = time - arilux_rf_lasttime;
|
||||||
|
|
||||||
|
if (duration > ARILUX_RF_SEPARATION_LIMIT) {
|
||||||
|
if (abs(duration - arilux_rf_timings[0]) < 200) {
|
||||||
|
arilux_rf_repeat_count++;
|
||||||
|
if (arilux_rf_repeat_count == 2) {
|
||||||
|
unsigned long code = 0;
|
||||||
|
const unsigned int delay = arilux_rf_timings[0] / 31;
|
||||||
|
const unsigned int delayTolerance = delay * ARILUX_RF_RECEIVE_TOLERANCE / 100;
|
||||||
|
|
||||||
|
for (unsigned int i = 1; i < arilux_rf_change_count -1; i += 2) {
|
||||||
|
code <<= 1;
|
||||||
|
if (abs(arilux_rf_timings[i] - delay) < delayTolerance && abs(arilux_rf_timings[i + 1] - (delay * 3)) < delayTolerance) {
|
||||||
|
// zero
|
||||||
|
} else if (abs(arilux_rf_timings[i] - (delay * 3)) < delayTolerance && abs(arilux_rf_timings[i + 1] - delay) < delayTolerance) {
|
||||||
|
// one
|
||||||
|
code |= 1;
|
||||||
|
} else {
|
||||||
|
// Failed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (arilux_rf_change_count > 7) { // ignore very short transmissions: no device sends them, so this must be noise
|
||||||
|
// if (arilux_rf_change_count > 48) { // ignore very short transmissions: no device sends them, so this must be noise
|
||||||
|
arilux_rf_received_value = code;
|
||||||
|
}
|
||||||
|
arilux_rf_repeat_count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arilux_rf_change_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// detect overflow
|
||||||
|
if (arilux_rf_change_count >= ARILUX_RF_MAX_CHANGES) {
|
||||||
|
arilux_rf_change_count = 0;
|
||||||
|
arilux_rf_repeat_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
arilux_rf_timings[arilux_rf_change_count++] = duration;
|
||||||
|
arilux_rf_lasttime = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AriluxRfHandler()
|
||||||
|
{
|
||||||
|
char command[16];
|
||||||
|
char value = '-';
|
||||||
|
|
||||||
|
unsigned long now = millis();
|
||||||
|
if (arilux_rf_received_value && !((arilux_rf_received_value == arilux_rf_last_received_value) && (now - arilux_rf_last_time < ARILUX_RF_TIME_AVOID_DUPLICATE))) {
|
||||||
|
arilux_rf_last_received_value = arilux_rf_received_value;
|
||||||
|
arilux_rf_last_time = now;
|
||||||
|
|
||||||
|
uint16_t hostcode = arilux_rf_received_value >> 8 & 0xFFFF;
|
||||||
|
if (Settings.rf_code[1][6] == Settings.rf_code[1][7]) {
|
||||||
|
Settings.rf_code[1][6] = hostcode >> 8 & 0xFF;
|
||||||
|
Settings.rf_code[1][7] = hostcode & 0xFF;
|
||||||
|
}
|
||||||
|
uint16_t stored_hostcode = Settings.rf_code[1][6] << 8 | Settings.rf_code[1][7];
|
||||||
|
if (hostcode == stored_hostcode) {
|
||||||
|
|
||||||
|
snprintf_P(log_data, sizeof(log_data), PSTR(D_LOG_RFR D_RECEIVED " 0x%06X"), arilux_rf_received_value);
|
||||||
|
AddLog(LOG_LEVEL_DEBUG);
|
||||||
|
|
||||||
|
command[0] = '\0';
|
||||||
|
uint8_t keycode = arilux_rf_received_value & 0xFF;
|
||||||
|
switch (keycode) {
|
||||||
|
case 1: // Power On
|
||||||
|
case 3: // Power Off
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_POWER " %d"), (1 == keycode) ? 1 : 0);
|
||||||
|
break;
|
||||||
|
case 2: // Toggle
|
||||||
|
arilux_rf_toggle++;
|
||||||
|
arilux_rf_toggle &= 0x3;
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_COLOR " %d"), 200 + arilux_rf_toggle);
|
||||||
|
break;
|
||||||
|
case 4: // Speed +
|
||||||
|
value = '+';
|
||||||
|
case 7: // Speed -
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_SPEED " %c"), value);
|
||||||
|
break;
|
||||||
|
case 5: // Scheme +
|
||||||
|
value = '+';
|
||||||
|
case 8: // Scheme -
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_SCHEME " %c"), value);
|
||||||
|
break;
|
||||||
|
case 6: // Dimmer +
|
||||||
|
value = '+';
|
||||||
|
case 9: // Dimmer -
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_DIMMER " %c"), value);
|
||||||
|
break;
|
||||||
|
default: {
|
||||||
|
if ((keycode >= 10) && (keycode <= 21)) {
|
||||||
|
snprintf_P(command, sizeof(command), PSTR(D_CMND_COLOR " %d"), keycode -9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen(command)) {
|
||||||
|
ExecuteCommand(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arilux_rf_received_value = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AriluxRfInit()
|
||||||
|
{
|
||||||
|
if ((pin[GPIO_ALIRFRCV] < 99) && (pin[GPIO_LED2] < 99)) {
|
||||||
|
if (Settings.last_module != Settings.module) {
|
||||||
|
Settings.rf_code[1][6] = 0;
|
||||||
|
Settings.rf_code[1][7] = 0;
|
||||||
|
Settings.last_module = Settings.module;
|
||||||
|
}
|
||||||
|
arilux_rf_received_value = 0;
|
||||||
|
digitalWrite(pin[GPIO_LED2], !bitRead(led_inverted, 1)); // Turn on RF
|
||||||
|
attachInterrupt(pin[GPIO_ALIRFRCV], AriluxRfInterrupt, CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // USE_ARILUX_RF
|
||||||
|
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* Sonoff B1 and AiLight inspired by OpenLight https://github.com/icamgo/noduino-sdk
|
* Sonoff B1 and AiLight inspired by OpenLight https://github.com/icamgo/noduino-sdk
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
@ -197,6 +358,15 @@ void LightInit(void)
|
|||||||
digitalWrite(14, LOW);
|
digitalWrite(14, LOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pin[GPIO_ALIRFRCV] < 99) {
|
||||||
|
#ifdef USE_ARILUX_RF
|
||||||
|
AriluxRfInit();
|
||||||
|
#else
|
||||||
|
if (pin[GPIO_LED2] < 99) {
|
||||||
|
digitalWrite(pin[GPIO_LED2], bitRead(led_inverted, 1)); // Turn off RF
|
||||||
|
}
|
||||||
|
#endif // USE_ARILUX_RF
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef USE_WS2812 // ************************************************************************
|
#ifdef USE_WS2812 // ************************************************************************
|
||||||
else if (LT_WS2812 == light_type) {
|
else if (LT_WS2812 == light_type) {
|
||||||
@ -733,6 +903,8 @@ boolean LightColorEntry(char *buffer, uint8_t buffer_length)
|
|||||||
buffer++;
|
buffer++;
|
||||||
buffer_length--;
|
buffer_length--;
|
||||||
}
|
}
|
||||||
|
uint8_t value = atoi(buffer);
|
||||||
|
memset(&light_entry_color, 0x00, sizeof(light_entry_color));
|
||||||
if (strstr(buffer, ",")) { // Decimal entry
|
if (strstr(buffer, ",")) { // Decimal entry
|
||||||
int8_t i = 0;
|
int8_t i = 0;
|
||||||
for (str = strtok_r(buffer, ",", &p); str && i < 6; str = strtok_r(NULL, ",", &p)) {
|
for (str = strtok_r(buffer, ",", &p); str && i < 6; str = strtok_r(NULL, ",", &p)) {
|
||||||
@ -749,6 +921,14 @@ boolean LightColorEntry(char *buffer, uint8_t buffer_length)
|
|||||||
}
|
}
|
||||||
entry_type = 1; // Hexadecimal
|
entry_type = 1; // Hexadecimal
|
||||||
}
|
}
|
||||||
|
else if ((value > 0) && (value <= MAX_FIXED_COLOR)) {
|
||||||
|
memcpy_P(&light_entry_color, &kFixedColor[value -1], 3);
|
||||||
|
entry_type = 1; // Hexadecimal
|
||||||
|
}
|
||||||
|
else if ((value > 199) && (value <= 199 + MAX_FIXED_COLD_WARM)) {
|
||||||
|
memcpy_P(&light_entry_color[3], &kFixedColdWarm[value -200], 2);
|
||||||
|
entry_type = 1; // Hexadecimal
|
||||||
|
}
|
||||||
if (entry_type) {
|
if (entry_type) {
|
||||||
Settings.flag.decimal_text = entry_type -1;
|
Settings.flag.decimal_text = entry_type -1;
|
||||||
}
|
}
|
||||||
@ -764,6 +944,7 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
boolean coldim = false;
|
boolean coldim = false;
|
||||||
boolean valid_entry = false;
|
boolean valid_entry = false;
|
||||||
char scolor[25];
|
char scolor[25];
|
||||||
|
char option = (1 == data_len) ? dataBuf[0] : '\0';
|
||||||
|
|
||||||
int command_code = GetCommandCode(command, sizeof(command), type, kLightCommands);
|
int command_code = GetCommandCode(command, sizeof(command), type, kLightCommands);
|
||||||
if ((CMND_COLOR == command_code) && (light_subtype > LST_SINGLE) && (index > 0) && (index <= 4)) {
|
if ((CMND_COLOR == command_code) && (light_subtype > LST_SINGLE) && (index > 0) && (index <= 4)) {
|
||||||
@ -771,9 +952,6 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
valid_entry = LightColorEntry(dataBuf, data_len);
|
valid_entry = LightColorEntry(dataBuf, data_len);
|
||||||
if (valid_entry) {
|
if (valid_entry) {
|
||||||
if (1 == index) { // Color(1)
|
if (1 == index) { // Color(1)
|
||||||
// for (byte i = 0; i < light_subtype; i++) {
|
|
||||||
// light_current_color[i] = light_entry_color[i];
|
|
||||||
// }
|
|
||||||
memcpy(light_current_color, light_entry_color, sizeof(light_current_color));
|
memcpy(light_current_color, light_entry_color, sizeof(light_current_color));
|
||||||
LightSetColor();
|
LightSetColor();
|
||||||
Settings.light_scheme = 0;
|
Settings.light_scheme = 0;
|
||||||
@ -833,6 +1011,12 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
#endif // USE_WS2812 ************************************************************************
|
#endif // USE_WS2812 ************************************************************************
|
||||||
else if ((CMND_SCHEME == command_code) && (light_subtype >= LST_RGB)) {
|
else if ((CMND_SCHEME == command_code) && (light_subtype >= LST_RGB)) {
|
||||||
uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX +7 : LS_MAX -1;
|
uint8_t max_scheme = (LT_WS2812 == light_type) ? LS_MAX +7 : LS_MAX -1;
|
||||||
|
if (('+' == option) && (Settings.light_scheme < max_scheme)) {
|
||||||
|
payload = Settings.light_scheme + ((0 == Settings.light_scheme) ? 2 : 1); // Skip wakeup
|
||||||
|
}
|
||||||
|
else if (('-' == option) && (Settings.light_scheme > 0)) {
|
||||||
|
payload = Settings.light_scheme - ((2 == Settings.light_scheme) ? 2 : 1); // Skip wakeup
|
||||||
|
}
|
||||||
if ((payload >= 0) && (payload <= max_scheme)) {
|
if ((payload >= 0) && (payload <= max_scheme)) {
|
||||||
Settings.light_scheme = payload;
|
Settings.light_scheme = payload;
|
||||||
if (LS_WAKEUP == Settings.light_scheme) {
|
if (LS_WAKEUP == Settings.light_scheme) {
|
||||||
@ -861,6 +1045,12 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CMND_DIMMER == command_code) {
|
else if (CMND_DIMMER == command_code) {
|
||||||
|
if ('+' == option) {
|
||||||
|
payload = (Settings.light_dimmer > 89) ? 100 : Settings.light_dimmer + 10;
|
||||||
|
}
|
||||||
|
else if ('-' == option) {
|
||||||
|
payload = (Settings.light_dimmer < 11) ? 1 : Settings.light_dimmer - 10;
|
||||||
|
}
|
||||||
if ((payload >= 0) && (payload <= 100)) {
|
if ((payload >= 0) && (payload <= 100)) {
|
||||||
Settings.light_dimmer = payload;
|
Settings.light_dimmer = payload;
|
||||||
light_update = 1;
|
light_update = 1;
|
||||||
@ -897,6 +1087,12 @@ boolean LightCommand(char *type, uint16_t index, char *dataBuf, uint16_t data_le
|
|||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, GetStateText(Settings.light_fade));
|
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_SVALUE, command, GetStateText(Settings.light_fade));
|
||||||
}
|
}
|
||||||
else if (CMND_SPEED == command_code) { // 1 - fast, 20 - very slow
|
else if (CMND_SPEED == command_code) { // 1 - fast, 20 - very slow
|
||||||
|
if (('+' == option) && (Settings.light_speed > 1)) {
|
||||||
|
payload = Settings.light_speed -1;
|
||||||
|
}
|
||||||
|
else if (('-' == option) && (Settings.light_speed < STATES)) {
|
||||||
|
payload = Settings.light_speed +1;
|
||||||
|
}
|
||||||
if ((payload > 0) && (payload <= STATES)) {
|
if ((payload > 0) && (payload <= STATES)) {
|
||||||
Settings.light_speed = payload;
|
Settings.light_speed = payload;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user