1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

add on_key trigger to matrix_keypad (#7830)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb
2024-11-25 14:21:47 -10:00
committed by GitHub
parent a70cee1dc1
commit d9d368d38e
13 changed files with 75 additions and 55 deletions

View File

@@ -0,0 +1,8 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 15
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 4
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 4
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 15
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -0,0 +1,15 @@
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
rows:
- pin: 10
- pin: 11
columns:
- pin: 12
- pin: 13
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 15
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);

View File

@@ -1,11 +1,5 @@
binary_sensor:
- platform: matrix_keypad
id: key4
row: 1
col: 1
- platform: matrix_keypad
id: key1
key: 1
packages:
common: !include common.yaml
matrix_keypad:
id: keypad
@@ -17,3 +11,5 @@ matrix_keypad:
- pin: 4
keys: "1234"
has_pulldowns: true
on_key:
- lambda: ESP_LOGI("KEY", "key %d pressed", x);