解决开灯状态未同步的问题

This commit is contained in:
2025-07-06 10:57:32 +08:00
parent 289bce290c
commit 0321d8ecbf
4 changed files with 5 additions and 2 deletions

View File

@ -903,7 +903,8 @@ int set_light(light_ctrl_source_e source,
switch (source) {
case APP_CLOSE_LIGHT:
close_light();
return 0;
start_report_task(REPORT_SWITCH | REPORT_LIGHT_MODE);
return -111;
break;
case DEV_POWER_ON:
case APP_OPEN_LIGHT:
@ -1427,6 +1428,8 @@ static void set_light2net_cfg_done(void)
g_device_control.fade_time = NET_CFG_DEFAULT_FADE_TIME;
fade_ctx.current_brightness = g_device_control.brightness_local;
fade_ctx.current_cct = g_device_control.cct_local;
fade_ctx.target_brightness = g_device_control.brightness_local;
fade_ctx.target_cct = g_device_control.cct_local;
calculate_pwm_duty(&g_device_control);
update_pwm_output(g_device_control.on, g_device_control.duty_cw, g_device_control.duty_ww);
}