Are you asking about the hardware configuration or the software? The behavior of the device in response to switches is all down to the firmware you are running on it, the one I’m most familiar with is Tasmota and it will certainly run on any generic esp8266 based module. On the hardware side you need your switch(es) to control the state of one or more GPIO pins, and then in software you can specify exactly how you’d like the output to respond to these inputs.