fix: send stop for inline tilt at a travel endpoint in self-stopping modes (#142)#143
Merged
clintongormley merged 1 commit intoJun 30, 2026
Merged
Conversation
…modes (Sese-Schneider#142) In inline tilt mode the slats are articulated by the main travel motor, so a tilt move drives the travel relay. When the cover is parked at a travel endpoint (fully open/closed) — the usual case when adjusting slats — the tilt move drives the motor *off* its limit switch, so it will NOT self-stop there. The self-stopping relay modes (toggle, pulse, wrapped — _self_stops_at_endpoints() True) took the endpoint self-stop branch in auto_stop_if_necessary, which skips the relay stop on the assumption the motor is seated against its physical limit. For a tilt move that assumption is wrong, so the stop was never sent and the cover ran on to the full endpoint (e.g. tilting open while fully closed rolled the blind all the way up). Sese-Schneider#125 fixed the analogous overshoot for switch mode by excluding tilt moves from the adjacent run-on branch (not self._moving_tilt). Hoist that exclusion into a shared `endpoint_applies = _at_endpoint(...) and not _moving_tilt` predicate and gate both endpoint branches on it, so a tilt move at an endpoint always falls through to the explicit stop. Real travel moves to an endpoint still skip the redundant stop (toggle re-pulse would restart the motor — Sese-Schneider#105). Add tests covering inline tilt at the closed and open endpoints in a self-stopping mode, plus a regression guard that a travel move to an endpoint still skips the stop.
There was a problem hiding this comment.
Pull request overview
This PR fixes an edge case in inline tilt mode where, in self-stopping relay modes, finishing a tilt move while the cover is parked at a travel endpoint (0%/100%) could skip sending a stop command, allowing the motor to run on and drive the cover to the full endpoint (issue #142).
Changes:
- Introduces a shared
endpoint_appliespredicate to ensure endpoint “self-stop skip” and “run-on” handling only applies to travel moves (not tilt moves) inauto_stop_if_necessary. - Adds regression tests covering inline tilt at both open/closed travel endpoints for self-stopping modes, plus a guard that real travel-to-endpoint still skips stop.
- Documents the fix in
CHANGELOG.mdunder Unreleased.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
custom_components/cover_time_based/cover_base.py |
Gates endpoint self-stop/run-on behavior behind a shared predicate that excludes tilt moves, ensuring inline tilt always sends an explicit stop at endpoints. |
tests/test_endpoint_self_stop.py |
Adds tests reproducing issue #142 at both endpoints and verifying travel moves still skip redundant stop in self-stopping modes. |
CHANGELOG.md |
Adds an Unreleased changelog entry describing the inline-tilt endpoint fix and its relation to #125. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #142. In inline tilt mode the slats are articulated by the main travel motor, so a tilt move drives the travel relay. When the cover is parked at a travel endpoint (fully open/closed) — the usual case when adjusting slats — the tilt move drives the motor off its limit switch, so it will not self-stop there.
The self-stopping relay modes (Toggle, Pulse, wrapped —
_self_stops_at_endpoints()True) took the endpoint self-stop branch inauto_stop_if_necessary, which skips the relay stop on the assumption the motor is seated against its physical limit. For a tilt move that assumption is wrong, so the stop was never sent and the cover ran on to the full endpoint — e.g. tilting the slats open while fully closed rolled the blind all the way up.This is the direct companion to #125, which fixed the analogous overshoot for Switch mode in the adjacent run-on branch (by excluding tilt moves with
not self._moving_tilt). #125 added that guard to the run-on branch only; the self-stop branch — the one the momentary/delegated modes take — never got it.The fix
Hoist the tilt-exclusion into a single shared predicate and gate both endpoint branches on it:
A tilt move at a travel endpoint now falls through to the explicit stop. Real travel moves to an endpoint still skip the redundant stop (a toggle re-pulse would restart the motor — #105). Dual-motor tilt is unaffected (handled by its own earlier
_moving_tilt_motorbranch). The change is behaviour-preserving for the run-on branch.Tests
The reporter independently identified the same one-line condition; this PR generalises it (shared predicate, both branches) and adds the missing test coverage for inline tilt on self-stopping modes.
Full suite: 1096 passing; ruff format + check clean.