Previously, in the Installing the Mosquitto MQTT broker section, we tested the installation by visiting the http://localhost:8083 URL, which gave us a web page with a slider. However, at the time, we could not change the LED's brightness. When you moved the slider, the web page was publishing MQTT messages to the Mosquitto broker, but no program was receiving the messages to change the LED's brightness.
In this section, we'll see the Python code that subscribes to a topic called led and processes the messages generated by the slider. We will start by running the Python code and making sure we can change the LED's brightness.