ESPHome 2026.8.0-dev
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::mpr121 {
8
10 public MPR121Channel,
11 public Parented<MPR121Component> {
12 public:
13 void set_channel(uint8_t channel) { this->channel_ = channel; }
14 void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };
15 void set_release_threshold(uint8_t release_threshold) { this->release_threshold_ = release_threshold; };
16
17 void setup() override;
18 void process(uint16_t data) override;
19
20 protected:
21 uint8_t channel_{0};
22 optional<uint8_t> touch_threshold_{};
23 optional<uint8_t> release_threshold_{};
24};
25
26} // namespace esphome::mpr121
Helper class to easily give an object a parent of type T.
Definition helpers.h:1881
Base class for all binary_sensor-type classes.
void set_touch_threshold(uint8_t touch_threshold)
void set_release_threshold(uint8_t release_threshold)