mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Revert "Merge pull request #9391 from s-hadinger/fade_256_dev"
This reverts commit 440976c993122d12587cc6a66ecacec5461a173b, reversing changes made to eb43fd56e3f5af83a9fc374eef0369652b04b2ef.
This commit is contained in:
parent
440976c993
commit
217addc2bb
@ -19,7 +19,6 @@
|
|||||||
- Add new shutter modes (#9244)
|
- Add new shutter modes (#9244)
|
||||||
- Add Zigbee auto-config when pairing
|
- Add Zigbee auto-config when pairing
|
||||||
- Add support for MLX90640 IR array temperature sensor by Christian Baars
|
- Add support for MLX90640 IR array temperature sensor by Christian Baars
|
||||||
- Change ``WakeUp`` uses 256 steps instead of 100 (#9241)
|
|
||||||
|
|
||||||
### 8.5.0 20200907
|
### 8.5.0 20200907
|
||||||
|
|
||||||
|
@ -263,6 +263,8 @@ struct LIGHT {
|
|||||||
uint32_t strip_timer_counter = 0; // Bars and Gradient
|
uint32_t strip_timer_counter = 0; // Bars and Gradient
|
||||||
power_t power = 0; // Power<x> for each channel if SetOption68, or boolean if single light
|
power_t power = 0; // Power<x> for each channel if SetOption68, or boolean if single light
|
||||||
|
|
||||||
|
uint16_t wakeup_counter = 0;
|
||||||
|
|
||||||
uint8_t entry_color[LST_MAX];
|
uint8_t entry_color[LST_MAX];
|
||||||
uint8_t current_color[LST_MAX];
|
uint8_t current_color[LST_MAX];
|
||||||
uint8_t new_color[LST_MAX];
|
uint8_t new_color[LST_MAX];
|
||||||
@ -274,13 +276,12 @@ struct LIGHT {
|
|||||||
uint8_t subtype = 0; // LST_ subtype
|
uint8_t subtype = 0; // LST_ subtype
|
||||||
uint8_t device = 0;
|
uint8_t device = 0;
|
||||||
uint8_t old_power = 1;
|
uint8_t old_power = 1;
|
||||||
uint8_t wakeup_active = 0; // 0=inctive, 1=on-going, 2=about to start, 3=will be triggered next cycle
|
uint8_t wakeup_active = 0;
|
||||||
|
uint8_t wakeup_dimmer = 0;
|
||||||
uint8_t fixed_color_index = 1;
|
uint8_t fixed_color_index = 1;
|
||||||
uint8_t pwm_offset = 0; // Offset in color buffer
|
uint8_t pwm_offset = 0; // Offset in color buffer
|
||||||
uint8_t max_scheme = LS_MAX -1;
|
uint8_t max_scheme = LS_MAX -1;
|
||||||
|
|
||||||
uint32_t wakeup_start_time = 0;
|
|
||||||
|
|
||||||
bool update = true;
|
bool update = true;
|
||||||
bool pwm_multi_channels = false; // SetOption68, treat each PWM channel as an independant dimmer
|
bool pwm_multi_channels = false; // SetOption68, treat each PWM channel as an independant dimmer
|
||||||
bool virtual_ct = false; // SetOption106, add a 5th virtual channel, only if SO106 = 1, SO68 = 0, Light is RGBW (4 channels), SO37 < 128
|
bool virtual_ct = false; // SetOption106, add a 5th virtual channel, only if SO106 = 1, SO68 = 0, Light is RGBW (4 channels), SO37 < 128
|
||||||
@ -1865,27 +1866,25 @@ void LightAnimate(void)
|
|||||||
light_controller.calcLevels(Light.new_color);
|
light_controller.calcLevels(Light.new_color);
|
||||||
break;
|
break;
|
||||||
case LS_WAKEUP:
|
case LS_WAKEUP:
|
||||||
{
|
if (2 == Light.wakeup_active) {
|
||||||
if (2 == Light.wakeup_active) {
|
Light.wakeup_active = 1;
|
||||||
Light.wakeup_active = 1;
|
for (uint32_t i = 0; i < Light.subtype; i++) {
|
||||||
for (uint32_t i = 0; i < Light.subtype; i++) {
|
Light.new_color[i] = 0;
|
||||||
Light.new_color[i] = 0;
|
|
||||||
}
|
|
||||||
Light.wakeup_start_time = millis();
|
|
||||||
}
|
}
|
||||||
// which step are we in a range 0..1023
|
Light.wakeup_counter = 0;
|
||||||
uint32_t step_10 = ((millis() - Light.wakeup_start_time) * 1023) / (Settings.light_wakeup * 1000);
|
Light.wakeup_dimmer = 0;
|
||||||
if (step_10 > 1023) { step_10 = 1023; } // sanity check
|
}
|
||||||
uint8_t wakeup_bri = changeUIntScale(step_10, 0, 1023, 0, LightStateClass::DimmerToBri(Settings.light_dimmer));
|
Light.wakeup_counter++;
|
||||||
|
if (Light.wakeup_counter > ((Settings.light_wakeup * STATES) / Settings.light_dimmer)) {
|
||||||
if (wakeup_bri != light_state.getBri()) {
|
Light.wakeup_counter = 0;
|
||||||
light_state.setBri(wakeup_bri);
|
Light.wakeup_dimmer++;
|
||||||
|
if (Light.wakeup_dimmer <= Settings.light_dimmer) {
|
||||||
|
light_state.setDimmer(Light.wakeup_dimmer);
|
||||||
light_controller.calcLevels();
|
light_controller.calcLevels();
|
||||||
for (uint32_t i = 0; i < Light.subtype; i++) {
|
for (uint32_t i = 0; i < Light.subtype; i++) {
|
||||||
Light.new_color[i] = Light.current_color[i];
|
Light.new_color[i] = Light.current_color[i];
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (1023 == step_10) {
|
|
||||||
Response_P(PSTR("{\"" D_CMND_WAKEUP "\":\"" D_JSON_DONE "\""));
|
Response_P(PSTR("{\"" D_CMND_WAKEUP "\":\"" D_JSON_DONE "\""));
|
||||||
ResponseLightState(1);
|
ResponseLightState(1);
|
||||||
ResponseJsonEnd();
|
ResponseJsonEnd();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user