I want to wake up wifi and then publish state, and then disable wifi. below is the code, Is the line of code “- delay: 10s” necessary? Will the wifi component automatically wait for the publish command to be executed before enter deep sleep command?
wifi:
enable_on_boot: false
on_connect:
then:
- lambda: |-
id(xxxx).publish_state(xxxx);
- delay: 10s
- deep_sleep.enter: xxxx
on_xxxx:
- wifi.enable: