ESPHome 2026.11.0b6
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;
31 bool write_packet_(const Am43Packet &packet, const LogString *what);
32 uint16_t char_handle_{0};
33 uint16_t pin_{0};
34 bool invert_position_{false};
35 bool logged_in_{false};
36};
37
38} // namespace esphome::am43
39
40#endif
void set_invert_position(bool invert_position)
Definition am43_cover.h:26
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
bool write_packet_(const Am43Packet &packet, const LogString *what)
Writes a request to the control characteristic; logs and returns false on failure.
cover::CoverTraits get_traits() override
void control(const cover::CoverCall &call) override
Base class for all cover devices.
Definition cover.h:115