From b98a242d4af6bd07e3fc4bb1854fe6c24ff80994 Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Tue, 17 Oct 2023 12:07:33 -0700 Subject: [PATCH] document new uart switch options (#3269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Samuel Sieb Co-authored-by: H. Árkosi Róbert --- components/switch/uart.rst | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/components/switch/uart.rst b/components/switch/uart.rst index cf1518a03..1be109264 100644 --- a/components/switch/uart.rst +++ b/components/switch/uart.rst @@ -26,15 +26,23 @@ The ``uart`` switch platform allows you to send a pre-defined sequence of bytes name: "UART Recurring Output" data: [0xDE, 0xAD, 0xBE, 0xEF] send_every: 1s + - platform: uart + name: "UART On/Off" + data: + turn_on: "TurnOn\r\n" + turn_off: "TurnOff\r\n" Configuration variables: ------------------------ -- **data** (**Required**, string or list of bytes): The data to send via UART. Either an ASCII string - or a list of bytes. -- **name** (**Required**, string): The name for the switch. -- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the UART hub. - **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **name** (*Optional*, string): The name for the switch. +- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the UART hub. +- **data** (*Optional*, string or list of bytes): The data to send via UART. Either an ASCII string + or a list of bytes or one or both of the following nested options (see example above). + + - **turn_on** (*Optional*, string or list of bytes): The data to send when turning on. + - **turn_off** (*Optional*, string or list of bytes): The data to send when turning off. - **send_every** (*Optional*, :ref:`config-time`): Sends recurring data instead of sending once. - All other options from :ref:`Switch `.