Skip to content

[feedback] Add FeedbacActuatorBase, migrate FeedbackCover (cover/valve refactor 6/7)#8

Closed
exciton wants to merge 123 commits into
cover_valve_refactorfrom
pr6/feedback-base
Closed

[feedback] Add FeedbacActuatorBase, migrate FeedbackCover (cover/valve refactor 6/7)#8
exciton wants to merge 123 commits into
cover_valve_refactorfrom
pr6/feedback-base

Conversation

@exciton
Copy link
Copy Markdown
Owner

@exciton exciton commented May 29, 2026

Mirrors the time_based and endstop refactors (PRs 2/5 and 3/5): extracts the feedback-cover control logic into a reusable FeedbackActuatorBase that drives any actuator entity through the IActuator interface, and moves the cover platform into a subpackage.

New layout:
feedback/init.py — FeedbackActuatorBase, FEEDBACK_ACTUATOR_SCHEMA,
apply_feedback_actuator_config helpers
feedback/feedback_actuator.h — shared base class (Component + IActuator*)
feedback/feedback_actuator.cpp — shared loop / control / sensor handling
feedback/cover/init.py — thin cover platform, AUTO_LOAD parent
feedback/cover/feedback_cover.h — FeedbackCover : FeedbackActuatorBase, Cover
feedback/cover/feedback_cover.cpp — get_traits + dump_config

No user-visible behaviour change. Existing YAML configurations continue to work unchanged.

What does this implement/fix?

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx

Example entry for config.yaml:

# Example config.yaml

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

kahrendt and others added 30 commits May 24, 2026 15:32
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Mirrors the time_based and endstop refactors (PRs 2/5 and 3/5):
extracts the feedback-cover control logic into a reusable
FeedbackActuatorBase that drives any actuator entity through the
IActuator interface, and moves the cover platform into a subpackage.

New layout:
  feedback/__init__.py            — FeedbackActuatorBase, FEEDBACK_ACTUATOR_SCHEMA,
                                    apply_feedback_actuator_config helpers
  feedback/feedback_actuator.h    — shared base class (Component + IActuator*)
  feedback/feedback_actuator.cpp  — shared loop / control / sensor handling
  feedback/cover/__init__.py      — thin cover platform, AUTO_LOAD parent
  feedback/cover/feedback_cover.h — FeedbackCover : FeedbackActuatorBase, Cover
  feedback/cover/feedback_cover.cpp — get_traits + dump_config

No user-visible behaviour change. Existing YAML configurations
continue to work unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 29, 2026

Memory Impact Analysis

Components: feedback
Platform: esp8266-ard

Metric Target Branch This PR Change
RAM 29,320 bytes 29,320 bytes ➡️ +0 bytes (0.00%)
Flash 273,483 bytes 273,635 bytes 📈 🔸 +152 bytes (+0.06%)
📊 Component Memory Breakdown
Component Target Flash PR Flash Change
[esphome]feedback 3,622 bytes 3,809 bytes 📈 🚨 +187 bytes (+5.16%)
[esphome]core 8,842 bytes 8,820 bytes 📉 ✅ -22 bytes (-0.25%)
🔍 Symbol-Level Changes (click to expand)

Changed Symbols

Symbol Target Size PR Size Change
esphome::feedback::FeedbackCover::control(esphome::cover::CoverCall const&) 234 bytes 6 bytes 📉 -228 bytes (-97.44%)
setup 985 bytes 963 bytes 📉 -22 bytes (-2.23%)
esphome::feedback::FeedbackCover::dump_config() 477 bytes 465 bytes 📉 -12 bytes (-2.52%)
feedback__gate__pstorage 144 bytes 148 bytes 📈 +4 bytes (+2.78%)
vtable for esphome::feedback::FeedbackCover 104 bytes 100 bytes 📉 -4 bytes (-3.85%)

New Symbols (top 15)

Symbol Size
esphome::feedback::FeedbackActuatorBase::recompute_position_() 343 bytes
esphome::feedback::FeedbackActuatorBase::start_direction_(esphome::actuator::ActuatorOperation) 337 bytes
esphome::feedback::FeedbackActuatorBase::control_(esphome::actuator::ActuatorCallBase const&) 244 bytes
esphome::feedback::FeedbackActuatorBase::endstop_reached_(bool) 194 bytes
esphome::feedback::FeedbackActuatorBase::loop() 189 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackActuatorBase::set_open_obstacle...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackActuatorBase::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackActuatorBase::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackActuatorBase::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
169 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackActuatorBase::set_close_obstacl...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackActuatorBase::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackActuatorBase::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackActuatorBase::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
169 bytes
esphome::feedback::FeedbackActuatorBase::setup() 157 bytes
esphome::feedback::FeedbackActuatorBase::is_at_target_() const 111 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackActuatorBase::set_close_sensor(...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackActuatorBase::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackActuatorBase::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackActuatorBase::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
103 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackActuatorBase::set_open_sensor(e...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackActuatorBase::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackActuatorBase::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackActuatorBase::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
99 bytes
esphome::feedback::FeedbackActuatorBase::set_current_operation_(esphome::actuator::ActuatorOperat...esphome::feedback::FeedbackActuatorBase::set_current_operation_(esphome::actuator::ActuatorOperation, bool)
84 bytes
esphome::feedback::FeedbackActuatorBase::stop_prev_trigger_() 58 bytes
vtable for esphome::feedback::FeedbackActuatorBase 48 bytes
esphome::feedback::FeedbackActuatorBase::loop()::__pstr__ 39 bytes
18 more new symbols... Total: 2,786 bytes

Removed Symbols (top 15)

Symbol Size
esphome::feedback::FeedbackCover::start_direction_(esphome::actuator::ActuatorOperation) 303 bytes
esphome::feedback::FeedbackCover::recompute_position_() 286 bytes
esphome::feedback::FeedbackCover::setup() 273 bytes
esphome::feedback::FeedbackCover::loop() 168 bytes
esphome::feedback::FeedbackCover::endstop_reached_(bool) 168 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackCover::set_open_obstacle_sensor...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackCover::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackCover::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackCover::set_open_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
133 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackCover::set_close_obstacle_senso...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackCover::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackCover::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackCover::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
133 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackCover::set_close_sensor(esphome...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackCover::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackCover::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackCover::set_close_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
95 bytes
esphome::Callback<void (bool)>::create<esphome::feedback::FeedbackCover::set_open_sensor(esphome:...esphome::Callback<void (bool)>::createesphome::feedback::FeedbackCover::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}(esphome::feedback::FeedbackCover::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&)::{lambda(void*, bool)#1}::_FUN(esphome::feedback::FeedbackCover::set_open_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}&&, bool)
89 bytes
esphome::feedback::FeedbackCover::is_at_target_() const 85 bytes
esphome::feedback::FeedbackCover::set_current_operation_(esphome::actuator::ActuatorOperation, bool) 72 bytes
esphome::feedback::FeedbackCover::stop_prev_trigger_() 59 bytes
esphome::feedback::FeedbackCover::loop()::__pstr__ 45 bytes
esphome::feedback::FeedbackCover::endstop_reached_(bool)::__pstr__ 39 bytes
esphome::feedback::FeedbackCover::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*...esphome::feedback::FeedbackCover::set_close_obstacle_sensor(esphome::binary_sensor::BinarySensor*)::{lambda(bool)#1}::operator()(bool) const::pstr
32 bytes
17 more removed symbols... Total: 2,356 bytes

Note: This analysis measures static RAM and Flash usage only (compile-time allocation).
Dynamic memory (heap) cannot be measured automatically.
⚠️ You must test this PR on a real device to measure free heap and ensure no runtime memory issues.

This analysis runs automatically when components change. Memory usage is measured from a representative test configuration.

swoboda1337 and others added 27 commits May 29, 2026 05:16
…nit tests

- Rename 6 `bin` locals to descriptive names (open_endstop, open_sensor,
  open_obstacle, close_endstop, close_sensor, close_obstacle) to avoid
  shadowing the Python built-in
- Expand unit tests to match endstop/time_based suite: two test classes,
  6 tests, Component-reachable-transitively check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: dependabot[bot] <support@github.com>
…tually saves RAM (esphome#16606)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…pable SRAM (esphome#16607)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
@exciton exciton closed this Jun 2, 2026
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.