Enable SetOption92 for platforms beyond ESP8266

This commit is contained in:
tony-fav 2021-12-08 13:09:54 -05:00
parent 74996fae0e
commit 79b534d239
1 changed files with 10 additions and 4 deletions

View File

@ -1855,10 +1855,12 @@ bool isChannelGammaCorrected(uint32_t channel) {
if (channel >= Light.subtype) { return false; } // Out of range if (channel >= Light.subtype) { return false; } // Out of range
#ifdef ESP8266 #ifdef ESP8266
if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) {
#else
if (Settings->flag4.pwm_ct_mode) {
#endif // ESP8266
if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return false; } // PMW reserved for CT if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return false; } // PMW reserved for CT
if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return false; } // PMW reserved for CT if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return false; } // PMW reserved for CT
} }
#endif // ESP8266
return true; return true;
} }
@ -1866,10 +1868,12 @@ bool isChannelGammaCorrected(uint32_t channel) {
bool isChannelCT(uint32_t channel) { bool isChannelCT(uint32_t channel) {
#ifdef ESP8266 #ifdef ESP8266
if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) {
#else
if (Settings->flag4.pwm_ct_mode) {
#endif // ESP8266
if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return true; } // PMW reserved for CT if ((LST_COLDWARM == Light.subtype) && (1 == channel)) { return true; } // PMW reserved for CT
if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return true; } // PMW reserved for CT if ((LST_RGBCW == Light.subtype) && (4 == channel)) { return true; } // PMW reserved for CT
} }
#endif // ESP8266
return false; return false;
} }
@ -2159,9 +2163,12 @@ bool calcGammaBulbs(uint16_t cur_col_10[5]) {
// Now we know ct_10 and white_bri10 (gamma corrected if needed) // Now we know ct_10 and white_bri10 (gamma corrected if needed)
#ifdef ESP8266
if ((LST_COLDWARM == Light.subtype) || (LST_RGBCW == Light.subtype)) { if ((LST_COLDWARM == Light.subtype) || (LST_RGBCW == Light.subtype)) {
#ifdef ESP8266
if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { // channel 1 is the color tone, mapped to cold channel (0..255) if ((PHILIPS == TasmotaGlobal.module_type) || (Settings->flag4.pwm_ct_mode)) { // channel 1 is the color tone, mapped to cold channel (0..255)
#else
if (Settings->flag4.pwm_ct_mode) { // channel 1 is the color tone, mapped to cold channel (0..255)
#endif // ESP8266
pwm_ct = true; pwm_ct = true;
// Xiaomi Philips bulbs follow a different scheme: // Xiaomi Philips bulbs follow a different scheme:
// channel 0=intensity, channel1=temperature // channel 0=intensity, channel1=temperature
@ -2170,7 +2177,6 @@ bool calcGammaBulbs(uint16_t cur_col_10[5]) {
return false; // avoid any interference return false; // avoid any interference
} }
} }
#endif // ESP8266
// Now see if we need to mix RGB and White // Now see if we need to mix RGB and White
// Valid only for LST_RGBW, LST_RGBCW, SetOption105 1, and white is zero (see doc) // Valid only for LST_RGBW, LST_RGBCW, SetOption105 1, and white is zero (see doc)