Skip to content

fix: add direction change delay to prevent immediate reversal#55

Open
clintongormley wants to merge 1 commit intoSese-Schneider:mainfrom
clintongormley:fix/direction-change-delay
Open

fix: add direction change delay to prevent immediate reversal#55
clintongormley wants to merge 1 commit intoSese-Schneider:mainfrom
clintongormley:fix/direction-change-delay

Conversation

@clintongormley
Copy link
Contributor

Summary

  • Adds a 1s delay between stop and direction change when reversing cover direction (e.g. opening while closing)
  • Without this delay, the new direction command fires immediately after the stop, before the motor has settled
  • Applies to all modes (switch, toggle, wrapped) via _direction_change_delay() in the base class
  • Delay is inserted in async_open_cover, async_close_cover, and set_position

Test plan

  • Added tests verifying direction change delay is called on reversal
  • All 696 existing tests pass
  • Manual test: open cover, then close while opening — verify motor stops before reversing

🤖 Generated with Claude Code

When reversing direction (e.g. opening while closing), the motor needs
time to stop before receiving a new direction command. Without this
delay, the new direction pulse fires immediately after the stop,
which can cause problems with motor controllers.

Adds a 1s delay between stop and direction change in async_open_cover,
async_close_cover, and set_position. The delay applies to all modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
clintongormley added a commit to clintongormley/ha-cover-time-based that referenced this pull request Mar 10, 2026
Merge of Sese-Schneider#55.

Adds a 1s pause between stopping and changing direction to let the
motor settle. Toggle mode overrides with pulse_time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant