Add step function for Tuya Zigbee curtains#3107
Conversation
| local PRESET_LEVEL = 50 | ||
| local PRESET_LEVEL_KEY = "_presetLevel" | ||
|
|
||
| local LATEST_TARGET_LEVEL = "latest_target_level" |
There was a problem hiding this comment.
Let's add '_' into value and make same style with other static variables
875dc77 to
e4cdedd
Compare
e4cdedd to
c899587
Compare
| @@ -22,6 +22,7 @@ local packet_id = 0 | |||
|
|
|||
| local PRESET_LEVEL = 50 | |||
| local PRESET_LEVEL_KEY = "_presetLevel" | |||
| local LATEST_TARGET_LEVEL = "_latest_target_level" | |||
c899587 to
5f22add
Compare
| local current_level = latest_target_level or | ||
| device:get_latest_state("main", capabilities.windowShadeLevel.ID, | ||
| capabilities.windowShadeLevel.shadeLevel.NAME) or 0 |
There was a problem hiding this comment.
For example, if the curtain is initially at level 30 and receives a +10 command, setting the target_level to 40, and then receives a +2 command when the actual curtain position reaches 35, the current_level might still be 30. If the current_level were used as the baseline and the target_level were set to 32, the motor would reverse. Therefore, the target_level is calculated based on the saved LATEST_TARGET_LEVEL and is set to 42.
|
Hi @zhangshen001, would you please create a ticket for this PR? Thank you |
Hi~ @hcarter-775 , the task ticket is CHAD-18662 "Add statelessWindowShadeLevelStep support to the Zigbee Window Covering driver", because Tuya curtain driver is not in the path of "zigbee-window-treatment", So, we submitted this separate PR. |
7e0bc46 to
ac62bc8
Compare
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests