ESPHome 2025.5.0
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 float get_setup_priority() const override { return setup_priority::DATA; }
27 void loop() override;
28
29 protected:
30 std::vector<TTP229Channel *> channels_{};
31 enum ErrorCode {
32 NONE = 0,
34 } error_code_{NONE};
35};
36
37} // namespace ttp229_lsf
38} // namespace esphome
Base class for all binary_sensor-type classes.
void publish_state(bool 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
float get_setup_priority() const override
Definition ttp229_lsf.h:26
std::vector< TTP229Channel * > channels_
Definition ttp229_lsf.h:30
void register_channel(TTP229Channel *channel)
Definition ttp229_lsf.h:23
const float DATA
For components that import data from directly connected sensors like DHT.
Definition component.cpp:19
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7