ESPHome 2025.9.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 {
10namespace ttp229_lsf {
11
13 public:
14 void set_channel(uint8_t channel) { channel_ = channel; }
15 void process(uint16_t data) { this->publish_state(data & (1 << this->channel_)); }
16
17 protected:
18 uint8_t channel_;
19};
20
22 public:
23 void register_channel(TTP229Channel *channel) { this->channels_.push_back(channel); }
24 void setup() override;
25 void dump_config() override;
26 void loop() override;
27
28 protected:
29 std::vector<TTP229Channel *> channels_{};
30 enum ErrorCode {
31 NONE = 0,
33 } error_code_{NONE};
34};
35
36} // namespace ttp229_lsf
37} // namespace esphome
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:133
void set_channel(uint8_t channel)
Definition ttp229_lsf.h:14
enum esphome::ttp229_lsf::TTP229LSFComponent::ErrorCode NONE
std::vector< TTP229Channel * > channels_
Definition ttp229_lsf.h:29
void register_channel(TTP229Channel *channel)
Definition ttp229_lsf.h:23
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7