The function was originally looping through the set of readings for a
particular time-stamp. If there was more than one reading above 39, it
would append that particular time-stamp every time the if-statement
was true -- as it looped through each reading for said time-stamp.
This change adds a break and a variable to track if the time-stamp
should be added to the list -- after it has broke out of the
if-block.
Having filtered down the list to readings which suppass the Hertz
threshold (4+ per-second at time of writing), the code here filters it
down even more. This bit of code searches for readings within this
already filtered list for any readings which activate the light in the
gallery (with the threshold matching that of 'gallery1' which in
anything over 39). It then proceeds to save the results.
This functions goes through the list of readings and forms a
dictionary of time-stamps, with light readings beyond a specified
readings-per-second threshold, and the reading for said time-stamp.
The results are then saved to the specified file, using
'save_rps_totals' function.