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