mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: J. Nick Koston <nick@koston.org>
37 lines
930 B
YAML
37 lines
930 B
YAML
tca8418:
|
|
# A 4x3 key matrix, with the remaining pins reporting as individual inputs.
|
|
- id: matrix_keypad_device
|
|
i2c_id: i2c_bus
|
|
address: 0x34
|
|
rows: 4
|
|
columns: 3
|
|
keys: "123456789*0#"
|
|
# The interrupt output is open drain, so it needs a pull-up. Use the
|
|
# internal one unless the board already has its own.
|
|
interrupt_pin:
|
|
number: ${interrupt_pin}
|
|
mode: INPUT_PULLUP
|
|
on_key:
|
|
- logger.log:
|
|
format: "Key: %c"
|
|
args: [x]
|
|
# Every pin reporting as an individual input, polled over I2C.
|
|
- id: inputs_only_device
|
|
i2c_id: i2c_bus
|
|
address: 0x35
|
|
|
|
binary_sensor:
|
|
- platform: tca8418
|
|
keypad_id: matrix_keypad_device
|
|
row: 0
|
|
col: 0
|
|
name: "Key top left"
|
|
- platform: tca8418
|
|
keypad_id: matrix_keypad_device
|
|
key: "5"
|
|
name: "Key five"
|
|
- platform: tca8418
|
|
keypad_id: inputs_only_device
|
|
key_code: 97
|
|
name: "Input ROW0"
|