ESPHome 2025.5.0
Loading...
Searching...
No Matches
tormatic_cover.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "tormatic_protocol.h"
7
8namespace esphome {
9namespace tormatic {
10
11using namespace esphome::cover;
12
14 public:
15 void setup() override;
16 void loop() override;
17 void update() override;
18 void dump_config() override;
19 float get_setup_priority() const override { return setup_priority::DATA; };
20
23
24 void publish_state(bool save = true, uint32_t ratelimit = 0);
25
27
28 protected:
29 void control(const cover::CoverCall &call) override;
30
33 void control_position_(float target);
34 void stop_at_target_();
35
36 template<typename T> void send_message_(MessageType t, T r);
37 template<typename T> optional<T> read_data_();
38 void drain_rx_(uint16_t n = 0);
39
42
45
46 uint32_t seq_tx_{0};
47
49
50 uint32_t open_duration_{0};
51 uint32_t close_duration_{0};
52 uint32_t last_publish_time_{0};
57};
58
59} // namespace tormatic
60} // namespace esphome
send_message_t send_message_
This class simplifies creating components that periodically check a state.
Definition component.h:301
Base class for all cover devices.
Definition cover.h:111
optional< GateStatus > read_gate_status_()
void recalibrate_duration_(GateStatus s)
optional< float > target_position_
void send_gate_command_(GateStatus s)
void control(const cover::CoverCall &call) override
void set_close_duration(uint32_t duration)
void control_position_(float target)
void handle_gate_status_(GateStatus s)
float get_setup_priority() const override
cover::CoverTraits get_traits() override
void set_open_duration(uint32_t duration)
void publish_state(bool save=true, uint32_t ratelimit=0)
uint8_t duration
Definition msa3xx.h:0
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7