[valve] Add endstop_valve platform (cover/valve refactor 4/5)#6
Closed
exciton wants to merge 15 commits into
Closed
[valve] Add endstop_valve platform (cover/valve refactor 4/5)#6exciton wants to merge 15 commits into
exciton wants to merge 15 commits into
Conversation
This was referenced May 24, 2026
Implements the endstop_valve component as a thin wrapper over EndstopActuatorBase, mirroring endstop/cover exactly but for valves. Adds config tests for esp32-idf, esp8266-ard, and rp2040-ard. https://claude.ai/code/session_01Q3vPAvxZLoVtM7PRo6CdgE
Remove get_has_built_in_endstop() and get_last_operation() from TimeBasedActuatorBase, and get_last_operation() from TimeBasedCover. None have any callers in the codebase or in Python codegen. https://claude.ai/code/session_01Q3vPAvxZLoVtM7PRo6CdgE
…onent Replaces the inline schema and to_code body with the helpers introduced in actuator/__init__.py, reducing valve.py from ~65 lines to ~22 lines.
9631be7 to
4920132
Compare
EndstopActuatorBase moved from actuator/ to endstop/ in PR2. Update EndstopValve to include from endstop/ and inherit endstop::, and update valve.py to import schema helpers from esphome.components.endstop. https://claude.ai/code/session_01Q3vPAvxZLoVtM7PRo6CdgE
- Move endstop_valve.h/cpp into endstop/, namespace esphome::endstop - Add endstop/valve.py (valve: platform: endstop) - Merge endstop_valve tests into tests/components/endstop/common.yaml - Delete esphome/components/endstop_valve/ and tests/components/endstop_valve/ https://claude.ai/code/session_01Q3vPAvxZLoVtM7PRo6CdgE
- Remove actuator/time_based_actuator.h/.cpp stubs (belong to PR3) - Restore get_last_operation() in time_based/cover/time_based_cover.h (that removal belonged to PR3 as well) https://claude.ai/code/session_01Q3vPAvxZLoVtM7PRo6CdgE
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
…tests - Move endstop/valve.py → endstop/valve/__init__.py (matching cover/ subpackage pattern from PR2) - Move endstop/endstop_valve.h/.cpp → endstop/valve/ subdirectory - Fix include path: "endstop_actuator.h" → "../endstop_actuator.h" - Fix import: from . → from .. - Add AUTO_LOAD = ["endstop"] (needed for subpackage source discovery) - Add TestEndstopValveInheritance class to test_endstop_actuator.py (3 tests: inherits base, inherits Valve, Component reachable transitively) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Cover/Valve Actuator Refactor — PR Series
Merge order: #3 → #4 and #5 (parallel) → #6 and #7 (parallel)
This PR: Step 4/5
What does this implement/fix?
Adds a new
endstop_valveplatform for thevalvecomponent, providing the same endstop-based position control thatendstopcover has, reusingEndstopActuatorBasefrom step 2/5 with no logic duplication.New
esphome/components/endstop_valve/:EndstopValveinheritsEndstopActuatorBase + Valveendstopcover platformdump_config()loggingTypes of changes
Related issue or feature (if applicable): fixes
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed:
Generated by Claude Code