mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-03 19:38:30 +02:00
add time based cover, has built in endstop (#665)
* add has built in endstop * rewrite as proposed * Update esphome/components/time_based/time_based_cover.h Co-Authored-By: Otto Winter <otto@otto-winter.com> * lint * Re trigger stop_operation if stop called * allow se triggering open/close command if safe * using COVER_OPEN/CLOSE constants
This commit is contained in:
committed by
Otto Winter
parent
d27291b997
commit
83a92f03fc
@@ -20,6 +20,7 @@ class TimeBasedCover : public cover::Cover, public Component {
|
||||
void set_open_duration(uint32_t open_duration) { this->open_duration_ = open_duration; }
|
||||
void set_close_duration(uint32_t close_duration) { this->close_duration_ = close_duration; }
|
||||
cover::CoverTraits get_traits() override;
|
||||
void set_has_built_in_endstop(bool value) { this->has_built_in_endstop_ = value; }
|
||||
|
||||
protected:
|
||||
void control(const cover::CoverCall &call) override;
|
||||
@@ -41,6 +42,7 @@ class TimeBasedCover : public cover::Cover, public Component {
|
||||
uint32_t start_dir_time_{0};
|
||||
uint32_t last_publish_time_{0};
|
||||
float target_position_{0};
|
||||
bool has_built_in_endstop_{false};
|
||||
};
|
||||
|
||||
} // namespace time_based
|
||||
|
||||
Reference in New Issue
Block a user