ESPHome 2025.5.0
Loading...
Searching...
No Matches
mpr121_binary_sensor.h
Go to the documentation of this file.
1#pragma once
2
4
5#include "../mpr121.h"
6
7namespace esphome {
8namespace mpr121 {
9
10class MPR121BinarySensor : public binary_sensor::BinarySensor, public MPR121Channel, public Parented<MPR121Component> {
11 public:
12 void set_channel(uint8_t channel) { this->channel_ = channel; }
13 void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };
14 void set_release_threshold(uint8_t release_threshold) { this->release_threshold_ = release_threshold; };
15
16 void setup() override;
17 void process(uint16_t data) override;
18
19 protected:
20 uint8_t channel_{0};
23};
24
25} // namespace mpr121
26} // namespace esphome
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
Base class for all binary_sensor-type classes.
void set_touch_threshold(uint8_t touch_threshold)
void set_release_threshold(uint8_t release_threshold)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7