diff --git a/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h b/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h index 905b6e5..4be48f6 100755 --- a/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h +++ b/application/samples/wifi/ohos_connect/hilink_adapt/product/device_profile.h @@ -30,7 +30,7 @@ extern "C" { #define DEVICE_HIVERSION "1.0.0" /* 设备固件版本号 */ -#define FIRMWARE_VER "1.0.0" +#define FIRMWARE_VER "1.0.1" /* 设备硬件版本号 */ #define HARDWARE_VER "1.0.0" /* 设备软件版本号 */ diff --git a/application/ws63/user_main/spotlight/device_module.c b/application/ws63/user_main/spotlight/device_module.c index 627e175..258e1fc 100644 --- a/application/ws63/user_main/spotlight/device_module.c +++ b/application/ws63/user_main/spotlight/device_module.c @@ -123,7 +123,6 @@ int myhandle_put_switch(const char* svc_id, const char* payload, unsigned int le } bool on = (item->valueint != 0); - g_device_control.on = on; ret = set_switch(on); cJSON_Delete(json); diff --git a/application/ws63/user_main/spotlight/spotlight_main.c b/application/ws63/user_main/spotlight/spotlight_main.c index 594d4a0..c34af37 100644 --- a/application/ws63/user_main/spotlight/spotlight_main.c +++ b/application/ws63/user_main/spotlight/spotlight_main.c @@ -506,10 +506,6 @@ void update_pwm_output(bool on_state, uint16_t duty_cw_val, uint16_t duty_ww_val uapi_pwm_open(channel_id_ww, &cfg_repeat); - // The line 'uint8_t channel_ids[2] = {channel_id_cw, channel_id_ww};' was present in the original code snippet from the checkpoint - // but seems unused before the uapi_pwm_start_group call. Retaining original behavior regarding this line. - // If it was indeed unused, it can be removed. For now, assuming it might have a purpose or was for debugging. - // uint8_t channel_ids[2] = {channel_id_cw, channel_id_ww}; // This line is commented out as it appears unused in the provided snippet. uapi_pwm_start_group(CONFIG_PWM_GROUP_ID); if (should_print(&pwm_limiter)) { @@ -897,6 +893,8 @@ int set_light(int32_t brightness_local, int32_t cct_local) return -111; // 异步上报 #endif } + g_device_control.cct_local = tmp_fade_ctx.target_cct; + g_device_control.brightness_local = tmp_fade_ctx.target_brightness; // no break; // 如果渐变时间是0则直接一步完成 default: //情景模式直接切换到对应的色温和亮度 set_switch(true); @@ -916,6 +914,7 @@ int set_switch(bool open) calculate_pwm_duty(); update_pwm_output(g_device_control.on, g_device_control.duty_cw, g_device_control.duty_ww); uapi_gpio_set_val(SWITCH_PIN, open ? OPEN_LIGHT : CLOSE_LIGHT); + req_save_device_data(); return 0; }