mirror of https://github.com/arendst/Tasmota.git
Merge pull request #7054 from s-hadinger/so68_autopower
Auto--power on/off when setting channel to non-zero or zero value
This commit is contained in:
commit
4130c16b6d
|
@ -6,6 +6,7 @@
|
||||||
- Change new Fade system much smoother, Speed now up to 40 (#6942, #3714)
|
- Change new Fade system much smoother, Speed now up to 40 (#6942, #3714)
|
||||||
- Fix Arduino IDE function prototyping compile error (#6982)
|
- Fix Arduino IDE function prototyping compile error (#6982)
|
||||||
- Change update lib IRremoteESP8266 updated to v2.7.1, -2.7k flash and -1.5k RAM for Tasmota-IR
|
- Change update lib IRremoteESP8266 updated to v2.7.1, -2.7k flash and -1.5k RAM for Tasmota-IR
|
||||||
|
- Fix auto--power on/off when setting channel to non-zero or zero value, when SetOption68 1
|
||||||
- Fix postpone saving settings to flash until Fade is complete, avoids pause in Fade
|
- Fix postpone saving settings to flash until Fade is complete, avoids pause in Fade
|
||||||
|
|
||||||
### 7.0.0.5 20191118
|
### 7.0.0.5 20191118
|
||||||
|
|
|
@ -1444,27 +1444,24 @@ void LightPreparePower(power_t channels = 0xFFFFFFFF) { // 1 = only RGB, 2 =
|
||||||
#endif
|
#endif
|
||||||
// If multi-channels, then we only switch off channels with a value of zero
|
// If multi-channels, then we only switch off channels with a value of zero
|
||||||
if (Light.pwm_multi_channels) {
|
if (Light.pwm_multi_channels) {
|
||||||
// for (uint32_t i = 0; i < Light.subtype; i++) {
|
for (uint32_t i = 0; i < Light.subtype; i++) {
|
||||||
// // if channel is non-null, channel is supposed to be on, but it is off, do Power On
|
if (bitRead(channels, i)) {
|
||||||
// if ((Light.current_color[i]) && (bitRead(Light.power, i)) && (0 == bitRead(power, i + Light.device - 1))) {
|
// if channel is non-null, channel is supposed to be on, but it is off, do Power On
|
||||||
// ExecuteCommandPower(Light.device + i, POWER_ON_NO_STATE, SRC_LIGHT);
|
if ((Light.current_color[i]) && (!bitRead(Light.power, i))) {
|
||||||
// //bitSet(Settings.power, i + Light.device - 1);
|
if (!Settings.flag.not_power_linked) { // SetOption20 - Control power in relation to Dimmer/Color/Ct changes
|
||||||
// #ifdef DEBUG_LIGHT
|
ExecuteCommandPower(Light.device + i, POWER_ON_NO_STATE, SRC_LIGHT);
|
||||||
// AddLog_P2(LOG_LEVEL_DEBUG, "ExecuteCommandPower ON device=%d", Light.device + i);
|
}
|
||||||
// #endif
|
} else {
|
||||||
// }
|
// if channel is zero and channel is on, set it off
|
||||||
// // if channel is zero and channel is on, set it off
|
if ((0 == Light.current_color[i]) && bitRead(Light.power, i)) {
|
||||||
// if ((0 == Light.current_color[i]) && bitRead(power, i + Light.device - 1)) {
|
ExecuteCommandPower(Light.device + i, POWER_OFF_NO_STATE, SRC_LIGHT);
|
||||||
// ExecuteCommandPower(Light.device + i, POWER_OFF_NO_STATE, SRC_LIGHT);
|
}
|
||||||
// //bitClear(Settings.power, i + Light.device - 1);
|
}
|
||||||
// #ifdef DEBUG_LIGHT
|
#ifdef USE_DOMOTICZ
|
||||||
// AddLog_P2(LOG_LEVEL_DEBUG, "ExecuteCommandPower OFF device=%d", Light.device + i);
|
DomoticzUpdatePowerState(Light.device + i);
|
||||||
// #endif
|
#endif // USE_DOMOTICZ
|
||||||
// }
|
}
|
||||||
// #ifdef USE_DOMOTICZ
|
}
|
||||||
// DomoticzUpdatePowerState(Light.device + i);
|
|
||||||
// #endif // USE_DOMOTICZ
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
if (light_controller.isCTRGBLinked()) { // linked, standard
|
if (light_controller.isCTRGBLinked()) { // linked, standard
|
||||||
if (light_state.getBri() && !(Light.power)) {
|
if (light_state.getBri() && !(Light.power)) {
|
||||||
|
|
Loading…
Reference in New Issue