Complete the code to start logging sensor data every minute.
scheduler.schedule_task(sensor.read_data, interval=[1])The interval is set in seconds. To log data every minute, use 60 seconds.
Complete the code to filter data points where temperature is above the threshold.
filtered_data = [d for d in data if d.temperature [1] threshold]
We want data points where temperature is greater than the threshold.
Fix the error in the code to calculate the average value of sensor readings.
average = sum(readings) [1] len(readings)
To find the average, divide the sum by the number of readings.
Fill both blanks to create a dictionary of sensor IDs and their latest values.
latest_values = {sensor.[1]: sensor.[2] for sensor in sensors}The dictionary keys are sensor IDs and values are the latest sensor readings.
Fill all three blanks to filter and report sensors with values above threshold.
report = {sensor.[1]: sensor.[2] for sensor in sensors if sensor.[3] > threshold}The report maps sensor IDs to their values, filtering those with values above the threshold.
