Skip to content

Add raw timings example to remote_transmitter #5070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions components/remote_transmitter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1047,10 +1047,23 @@ Lambda calls
************

Actions may also be called from :ref:`lambdas <config-lambda>`. The ``.transmit()`` call can be populated with
encoded data for a specific protocol by following the example below.
raw timings or encoded data for a specific protocol by following the examples below.
See the full API Reference for more info.

- ``.transmit()``: Transmit an IR code using the remote transmitter.
- ``.transmit()``: Transmit a signal using the remote transmitter.

.. code-block:: cpp

// Example - transmit raw timings
auto call = id(my_transmitter).transmit();
esphome::remote_base::RawTimings timings = {+601, -613, +601, -613, +601, -613, +601, -613};
timings.push_back(+405);
timings.push_back(-209);
call.get_data()->set_data(timings);
call.set_send_times(3);
// wait time in micro-seconds; 2 000 µs (=2 ms) is common
call.set_send_wait(2000);
call.perform();

.. code-block:: cpp

Expand All @@ -1061,6 +1074,8 @@ See the full API Reference for more info.
call.set_send_times(2);
call.perform();



See Also
--------

Expand Down