From f464770315eee356e717476dbf5d85be7d736361 Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Mon, 25 Nov 2024 14:21:51 -1000 Subject: [PATCH] document new key trigger (#4467) Co-authored-by: Samuel Sieb --- components/matrix_keypad.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/matrix_keypad.rst b/components/matrix_keypad.rst index bf9703223..60d369241 100644 --- a/components/matrix_keypad.rst +++ b/components/matrix_keypad.rst @@ -34,6 +34,8 @@ Component - pin: GPIOXX keys: "123A456B789C*0#D" has_diodes: false + on_key: + - lambda: ESP_LOGI("KEY", "key %d pressed", x); Configuration variables: @@ -81,6 +83,13 @@ Configuration variables: Either the ``row`` and ``col`` parameters, or the ``key`` parameter has to be provided. +Automations: +------------ + +- **on_key** (*Optional*, :ref:`Automation `): An automation to perform + when a key has been pressed. The key is in a variable called ``x``. + + .. note:: Automatic handling of multiple keys (e.g. PIN code entry) is possible with the