YAML Configuration variables and/or post-setup of should_broadcast_/should_listen_ for UDP component #3797
Unanswered
juanboro
asked this question in
Component enhancements
Replies: 1 comment
|
🏷️ I've automatically added the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Component name
udp
Link to component documentation on our website
https://esphome.io/components/udp/
Describe the enhancement
Currently, the UDP component will configure itself during setup() as a broadcast socket only if a udp.write action is created. Similarly it will only configure as a listen socket if a on-receive trigger is created.
The requested enhancement would to be to add optional specific ability to configure the UDP config instance as broadcaster and/or listener, ie:
It also would be good if public methods like send_packet would either just return/error if broadcast isn't set or perhaps - just have it do the socket setup. Right now ... it core dumps kind of like this...
In my case where I need to use send_packet in a lambda, I have to currently work around this like this:
Use cases
This allows using the send_packet method in lambdas - for example piping remote_receiver data out to UDP.
Anything else?
An example of use in remote_receiver - here: esp32-cc1101-udp-example.yaml
All reactions