ESPHome 2025.5.0
Loading...
Searching...
No Matches
sx1509_binary_keypad_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome {
7namespace sx1509 {
8
10 public:
11 void set_row_col(uint8_t row, uint8_t col) { this->key_ = (1 << (col + 8)) | (1 << row); }
12 void process(uint16_t data) override { this->publish_state(static_cast<bool>(data == key_)); }
13
14 protected:
15 uint16_t key_{0};
16};
17
18} // namespace sx1509
19} // namespace esphome
Base class for all binary_sensor-type classes.
void publish_state(bool state)
Publish a new state to the front-end.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7