ESPHome
2025.9.0-dev
Loading...
Searching...
No Matches
esphome
components
ble_client
switch
ble_switch.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/component.h
"
4
#include "
esphome/components/ble_client/ble_client.h
"
5
#include "
esphome/components/esp32_ble_tracker/esp32_ble_tracker.h
"
6
#include "
esphome/components/switch/switch.h
"
7
8
#ifdef USE_ESP32
9
#include <esp_gattc_api.h>
10
11
namespace
esphome
{
12
namespace
ble_client {
13
14
namespace
espbt
=
esphome::esp32_ble_tracker
;
15
16
class
BLEClientSwitch
:
public
switch_::Switch
,
public
Component
,
public
BLEClientNode
{
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
23
protected
:
24
void
write_state
(
bool
state
)
override
;
25
};
26
27
}
// namespace ble_client
28
}
// namespace esphome
29
#endif
ble_client.h
esphome::Component
Definition
component.h:71
esphome::ble_client::BLEClientNode
Definition
ble_client.h:27
esphome::ble_client::BLEClientSwitch
Definition
ble_switch.h:16
esphome::ble_client::BLEClientSwitch::loop
void loop() override
Definition
ble_switch.h:19
esphome::ble_client::BLEClientSwitch::dump_config
void dump_config() override
Definition
ble_switch.cpp:32
esphome::ble_client::BLEClientSwitch::write_state
void write_state(bool state) override
Definition
ble_switch.cpp:12
esphome::ble_client::BLEClientSwitch::gattc_event_handler
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) override
Definition
ble_switch.cpp:17
esphome::switch_::Switch
Base class for all switches.
Definition
switch.h:39
esphome::switch_::Switch::state
bool state
The current reported state of the binary sensor.
Definition
switch.h:56
component.h
esp32_ble_tracker.h
esphome::esp32_ble_tracker
Definition
automation.h:8
esphome
Providing packet encoding functions for exchanging data with a remote host.
Definition
a01nyub.cpp:7
switch.h
Generated by
1.12.0