D1 Mini ESP8266 Wifi and IOT button - help embedding two functions when IOT switch is activated

Hi, please edit your post above so that the code is posted correctly, using code tags. Also please read the forum guide so you can avoid breaking any other forum rules! Thanks!

PS. Please click Tools->Auto Format in the IDE to correct the indentation of the code before posting it.