ESPHome 2025.7.0
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;
26 void set_pin(uint16_t pin) { this->pin_ = pin; }
27 void set_invert_position(bool invert_position) { this->invert_position_ = invert_position; }
28
29 protected:
30 void control(const cover::CoverCall &call) override;
31 uint16_t char_handle_;
32 uint16_t pin_;
34 std::unique_ptr<Am43Encoder> encoder_;
35 std::unique_ptr<Am43Decoder> decoder_;
37
38 float position_;
39};
40
41} // namespace am43
42} // namespace esphome
43
44#endif
void set_invert_position(bool invert_position)
Definition am43_cover.h:27
std::unique_ptr< Am43Encoder > encoder_
Definition am43_cover.h:34
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
void set_pin(uint16_t pin)
Definition am43_cover.h:26
cover::CoverTraits get_traits() override
std::unique_ptr< Am43Decoder > decoder_
Definition am43_cover.h:35
void control(const cover::CoverCall &call) override
Base class for all cover devices.
Definition cover.h:111
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7