Switch and light(s) using one ESP8266

I have a wall spot light with button. I would like to use the button as a control button and the light as a controlled (RGBW) light. Can I do that with just one esp8266 (ESP-12 in this case)?

If so, an example of the code would be appreciated.

If the button is attached to the same esp8266 you could be able to pull that off with ESPhome and diyhue integration.