ESPHome 2025.5.0
Loading...
Searching...
No Matches
ble_switch.h
Go to the documentation of this file.
1#pragma once
2
7
8#ifdef USE_ESP32
9#include <esp_gattc_api.h>
10
11namespace esphome {
12namespace ble_client {
13
15
17 public:
18 void dump_config() override;
19 void loop() override {}
20 void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
21 esp_ble_gattc_cb_param_t *param) override;
22 float get_setup_priority() const override { return setup_priority::DATA; }
23
24 protected:
25 void write_state(bool state) override;
26};
27
28} // namespace ble_client
29} // namespace esphome
30#endif
float get_setup_priority() const override
Definition ble_switch.h:22
void write_state(bool state) override
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
Base class for all switches.
Definition switch.h:39
bool state
The current reported state of the binary sensor.
Definition switch.h:53
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