MQTT light dimmer with nodeMCU

if (message == "1") setLightLevel(50);

where your setLightLevel() function sets it to the level indicated, in this case 50%.