ESPHome 2026.6.0-dev
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::am43 {
14
16
18 public:
19 void setup() override;
20 void loop() override;
21 void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
22 esp_ble_gattc_cb_param_t *param) override;
23 void dump_config() override;
25 void set_pin(uint16_t pin) { this->pin_ = pin; }
26 void set_invert_position(bool invert_position) { this->invert_position_ = invert_position; }
27
28 protected:
29 void control(const cover::CoverCall &call) override;
30 uint16_t char_handle_;
31 uint16_t pin_;
33 std::unique_ptr<Am43Encoder> encoder_;
34 std::unique_ptr<Am43Decoder> decoder_;
36
37 float position_;
38};
39
40} // namespace esphome::am43
41
42#endif
void set_invert_position(bool invert_position)
Definition am43_cover.h:26
std::unique_ptr< Am43Encoder > encoder_
Definition am43_cover.h:33
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:25
cover::CoverTraits get_traits() override
std::unique_ptr< Am43Decoder > decoder_
Definition am43_cover.h:34
void control(const cover::CoverCall &call) override
Base class for all cover devices.
Definition cover.h:110