How control wifi in esphome?

Hello,
I want to disable the wifi in my esp switch between some hours + set a physical button to enable it with 2 clicks and disable it with 3 clicks.
anyone can help with this?>

https://esphome.io/components/wifi#wifi-disable-action

Please do not private message for help.

Hi i sew it.
But it is not work for me

And i new in esp
Can you help with this?

So what code have you tried and what do your esp logs say?