ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
time_based_cover.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace time_based {
9
10class TimeBasedCover : public cover::Cover, public Component {
11 public:
12 void setup() override;
13 void loop() override;
14 void dump_config() override;
15
19 void set_open_duration(uint32_t open_duration) { this->open_duration_ = open_duration; }
20 void set_close_duration(uint32_t close_duration) { this->close_duration_ = close_duration; }
22 void set_has_built_in_endstop(bool value) { this->has_built_in_endstop_ = value; }
23 void set_manual_control(bool value) { this->manual_control_ = value; }
24 void set_assumed_state(bool value) { this->assumed_state_ = value; }
26
27 protected:
28 void control(const cover::CoverCall &call) override;
29 void stop_prev_trigger_();
30 bool is_at_target_() const;
31
33
35
41
44 uint32_t start_dir_time_{0};
45 uint32_t last_publish_time_{0};
48 bool manual_control_{false};
49 bool assumed_state_{false};
51};
52
53} // namespace time_based
54} // namespace esphome
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
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7