ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
ttp229_lsf.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <vector>
8
9namespace esphome::ttp229_lsf {
10
12 public:
13 void set_channel(uint8_t channel) { channel_ = channel; }
14 void process(uint16_t data) { this->publish_state(data & (1 << this->channel_)); }
15
16 protected:
17 uint8_t channel_;
18};
19
21 public:
22 void register_channel(TTP229Channel *channel) { this->channels_.push_back(channel); }
23 void setup() override;
24 void dump_config() override;
25 void loop() override;
26
27 protected:
28 std::vector<TTP229Channel *> channels_{};
29 enum ErrorCode {
30 NONE = 0,
32 } error_code_{NONE};
33};
34
35} // namespace esphome::ttp229_lsf
Base class for all binary_sensor-type classes.
void publish_state(bool new_state)
Publish a new state to the front-end.
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
void set_channel(uint8_t channel)
Definition ttp229_lsf.h:13
enum esphome::ttp229_lsf::TTP229LSFComponent::ErrorCode NONE
std::vector< TTP229Channel * > channels_
Definition ttp229_lsf.h:28
void register_channel(TTP229Channel *channel)
Definition ttp229_lsf.h:22