code for controlling a light switch using a relay, nodemcu from my PC

I want to control a 2 channel relay switch using a voice device but I don't know how to code the nodemcu. I've been able to start the MQTT on the PC but unable to do same on the nodemcu especially controlling the pins for the light which are connected to D7 and D6 on the nodemcu.

Here is my setup;

on the picture attached!

how do I edit the arduino code to achieve my aim above

lights_control.ino (1.45 KB)

I have recently seen lots of examples recently of how to spoof the ESP to let it present as an IOT sensor/switch to Alexa/Google or whatever voice control platform they were dealing with.