ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
time_based_cover.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::time_based {
8
9class TimeBasedCover : public cover::Cover, public Component {
10 public:
11 void setup() override;
12 void loop() override;
13 void dump_config() override;
14
18 void set_open_duration(uint32_t open_duration) { this->open_duration_ = open_duration; }
19 void set_close_duration(uint32_t close_duration) { this->close_duration_ = close_duration; }
21 void set_has_built_in_endstop(bool value) { this->has_built_in_endstop_ = value; }
22 void set_manual_control(bool value) { this->manual_control_ = value; }
23 void set_assumed_state(bool value) { this->assumed_state_ = value; }
25
26 protected:
27 void control(const cover::CoverCall &call) override;
28 void stop_prev_trigger_();
29 bool is_at_target_() const;
30
32
34
40
47 bool manual_control_{false};
48 bool assumed_state_{false};
50};
51
52} // namespace esphome::time_based
Base class for all cover devices.
Definition cover.h:110
cover::CoverTraits get_traits() override
cover::CoverOperation get_last_operation() const
void start_direction_(cover::CoverOperation dir)
void set_close_duration(uint32_t close_duration)
void set_open_duration(uint32_t open_duration)
void control(const cover::CoverCall &call) override
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
static void uint32_t