mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
Co-authored-by: J. Nick Koston <nick@home-assistant.io> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: J. Nick Koston <nick@koston.org>
21 lines
563 B
YAML
21 lines
563 B
YAML
udp:
|
|
id: my_udp
|
|
listen_address: 239.0.60.53
|
|
addresses: ["239.0.60.53"]
|
|
on_receive:
|
|
- logger.log:
|
|
format: "Received %zu bytes"
|
|
args: [data.size()]
|
|
- udp.write:
|
|
id: my_udp
|
|
data: "hello world"
|
|
- udp.write:
|
|
id: my_udp
|
|
data: !lambda |-
|
|
return std::vector<uint8_t>{1,3,4,5,6};
|
|
# Short forms without id: valid while there is a single udp instance
|
|
- udp.write:
|
|
data: [0x01, 0x02, 0x03]
|
|
- udp.write: !lambda |-
|
|
return std::vector<uint8_t>(data.begin(), data.end());
|