ESPHome 2025.5.1
Loading...
Searching...
No Matches
am43_cover.h
Go to the documentation of this file.
1#pragma once
2
8
9#ifdef USE_ESP32
10
11#include <esp_gattc_api.h>
12
13namespace esphome {
14namespace am43 {
15
17
19 public:
20 void setup() override;
21 void loop() override;
22 void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
23 esp_ble_gattc_cb_param_t *param) override;
24 void dump_config() override;
25 float get_setup_priority() const override { return setup_priority::DATA; }
27 void set_pin(uint16_t pin) { this->pin_ = pin; }
28 void set_invert_position(bool invert_position) { this->invert_position_ = invert_position; }
29
30 protected:
31 void control(const cover::CoverCall &call) override;
32 uint16_t char_handle_;
33 uint16_t pin_;
35 std::unique_ptr<Am43Encoder> encoder_;
36 std::unique_ptr<Am43Decoder> decoder_;
38
39 float position_;
40};
41
42} // namespace am43
43} // namespace esphome
44
45#endif
void set_invert_position(bool invert_position)
Definition am43_cover.h:28
std::unique_ptr< Am43Encoder > encoder_
Definition am43_cover.h:35
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
float get_setup_priority() const override
Definition am43_cover.h:25
void set_pin(uint16_t pin)
Definition am43_cover.h:27
cover::CoverTraits get_traits() override
std::unique_ptr< Am43Decoder > decoder_
Definition am43_cover.h:36
void control(const cover::CoverCall &call) override
Base class for all cover devices.
Definition cover.h:111
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