Instead of turning the LED on and off directly, you can use the colours as an indicator or a warning.
You will need to decide what you would like to warn about - one specific sensor, use the sensor's 'overall air quality measurement', or just a different colour for different sensors?
In the code example below, we will use red to indicate the the temperature is higher than 25C, orange to indicate that it is lower than 15C, and green when it is in between:
temp = values.get('Temp')
if temp >= 25:
red.on()
green.off()
elif temp >= 15:
red.off()
green.on()
else:
red.on()
green.on()
elif means that this code will be ignored if the top condition is met, so you should check the most extreme case first.
In the example above, the LED responds to the temperature.
Other options include:
temp = values.get('Temp')
humidity = values.get('RH')
co2 = values.get('CO2')
voc = values.get('VOC')
co2_rating = values.get('CO2_Rating')
voc_ration = values.get('VOC_Rating')
air_quality_index = values.get('AQI')
There is another way to use the RGB LED, by importing a library.
Some in-progress instructions can be seen here.
Check back here in the future for some instructions!