ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
sx1509_binary_keypad_sensor.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::sx1509 {
7
9 public:
10 void set_row_col(uint8_t row, uint8_t col) { this->key_ = (1 << (col + 8)) | (1 << row); }
11 void process(uint16_t data) override { this->publish_state(static_cast<bool>(data == key_)); }
12
13 protected:
14 uint16_t key_{0};
15};
16
17} // namespace esphome::sx1509
Base class for all binary_sensor-type classes.
void publish_state(bool new_state)
Publish a new state to the front-end.
Here you'll find the Arduino code used to interface with the SX1509 I2C 16 I/O expander.