 
 
 // Methods
-bool readSensorData(float* temperature, float* humidity) {
+bool readSensorData(float* temperature, float* humidity, uint16_t* brightness) {
     const uint8_t SENSOR_READING_ATTEMPTS = 3;
     const uint8_t SENSOR_READING_INTERVAL = 3 * 1000;
 

        if (!isHumidityValid) {
            Serial.print("Reading valid humidity failed: ");
            Serial.println(*humidity);
        }

        // Wait in between attempts

    for (uint8_t sensorReadAttempt = 0; sensorReadAttempt < SENSOR_READING_ATTEMPTS; sensorReadAttempt++) {
        *temperature = weatherSensor.readTemperature(false, false);
        *humidity = weatherSensor.readHumidity(false);
        *brightness = analogRead(PHOTORESISTOR_PIN);

        bool isTemperatureValid = !isnan(*temperature) && *temperature >= -40.0 && *temperature <= 80.0;
        bool isHumidityValid = !isnan(*humidity) && *humidity >= 0.0 && *humidity <= 100.0;
        bool isBrightnessValid = !isnan(*brightness) && *brightness >= 0 && *brightness <= 1023;

        if (isTemperatureValid && isHumidityValid && isBrightnessValid) {
            Serial.print("Reading sensor data successful (temperature: ");
            Serial.print(*temperature);
            Serial.print("C, humidity: ");
            Serial.print(*humidity);
            Serial.print("%, brightness: ");
            Serial.print(*brightness);
            Serial.println(")");

            return true;
        }
