ESPHome 2026.5.1
Loading...
Searching...
No Matches
feedback_cover.h
Go to the documentation of this file.
1#pragma once
2
5
6#ifdef USE_BINARY_SENSOR
8#endif
10
11namespace esphome::feedback {
12
13class FeedbackCover : public cover::Cover, public Component {
14 public:
15 void setup() override;
16 void loop() override;
17 void dump_config() override;
18
22
23#ifdef USE_BINARY_SENSOR
30#endif
33 void set_has_built_in_endstop(bool value) { this->has_built_in_endstop_ = value; }
34 void set_assumed_state(bool value) { this->assumed_state_ = value; }
35 void set_max_duration(uint32_t max_duration) { this->max_duration_ = max_duration; }
36 void set_obstacle_rollback(float obstacle_rollback) { this->obstacle_rollback_ = obstacle_rollback; }
37 void set_update_interval(uint32_t interval) { this->update_interval_ = interval; }
38 void set_infer_endstop(bool infer_endstop) { this->infer_endstop_ = infer_endstop; }
40 void set_acceleration_wait_time(uint32_t waittime) { this->acceleration_wait_time_ = waittime; }
41
43
44 protected:
45 void control(const cover::CoverCall &call) override;
46 void stop_prev_trigger_();
47 bool is_at_target_() const;
50 void endstop_reached_(bool open_endstop);
52 void set_current_operation_(cover::CoverOperation operation, bool is_triggered);
53
54#ifdef USE_BINARY_SENSOR
61
62#endif
66
70 optional<uint32_t> direction_change_waittime_{};
73 bool assumed_state_{false};
74 bool infer_endstop_{false};
76
85};
86
87} // namespace esphome::feedback
Base class for all binary_sensor-type classes.
Base class for all cover devices.
Definition cover.h:110
cover::CoverTraits get_traits() override
cover::CoverOperation current_trigger_operation_
binary_sensor::BinarySensor * open_endstop_
void start_direction_(cover::CoverOperation dir)
void set_has_built_in_endstop(bool value)
void set_open_obstacle_sensor(binary_sensor::BinarySensor *open_obstacle)
void set_open_sensor(binary_sensor::BinarySensor *open_feedback)
void set_current_operation_(cover::CoverOperation operation, bool is_triggered)
binary_sensor::BinarySensor * close_endstop_
void set_close_endstop(binary_sensor::BinarySensor *close_endstop)
optional< uint32_t > direction_change_waittime_
binary_sensor::BinarySensor * close_obstacle_
void set_close_obstacle_sensor(binary_sensor::BinarySensor *close_obstacle)
void control(const cover::CoverCall &call) override
binary_sensor::BinarySensor * open_feedback_
void set_max_duration(uint32_t max_duration)
void set_open_duration(uint32_t duration)
void set_direction_change_waittime(uint32_t waittime)
void endstop_reached_(bool open_endstop)
void set_open_endstop(binary_sensor::BinarySensor *open_endstop)
cover::CoverOperation last_operation_
binary_sensor::BinarySensor * open_obstacle_
void set_close_duration(uint32_t duration)
binary_sensor::BinarySensor * close_feedback_
void set_infer_endstop(bool infer_endstop)
void update_operation_(cover::CoverOperation dir)
void set_update_interval(uint32_t interval)
void set_acceleration_wait_time(uint32_t waittime)
void set_obstacle_rollback(float obstacle_rollback)
void set_close_sensor(binary_sensor::BinarySensor *close_feedback)
uint8_t duration
Definition msa3xx.h:0
CoverOperation
Enum encoding the current operation of a cover.
Definition cover.h:79
@ COVER_OPERATION_OPENING
The cover is currently opening.
Definition cover.h:83
@ COVER_OPERATION_IDLE
The cover is currently idle (not moving)
Definition cover.h:81
static void uint32_t