Fix the furnace threshold and run-time calculation #34
@@ -133,7 +133,8 @@ def history():
 | 
			
		||||
    return render_template("history.html",  timezone = timezone,
 | 
			
		||||
                                            graphJSON = graphJSON,
 | 
			
		||||
                                            total_minutes = sum(streak_minutes),
 | 
			
		||||
                                            range_hours = range_hours
 | 
			
		||||
                                            range_hours = range_hours,
 | 
			
		||||
                                            debug = streak_minutes,
 | 
			
		||||
                                            )
 | 
			
		||||
# Calculate streak lengths (https://stackoverflow.com/a/20614650/2152245)                                            
 | 
			
		||||
def streak_lengths(temps):
 | 
			
		||||
@@ -144,10 +145,10 @@ def streak_lengths(temps):
 | 
			
		||||
        for idx, (x, y) in enumerate(zip(temps, temps[1:])):
 | 
			
		||||
            if x > y:
 | 
			
		||||
                streaks.append(idx - start)
 | 
			
		||||
                start = idx
 | 
			
		||||
                start = idx 
 | 
			
		||||
        else:
 | 
			
		||||
            streaks.append(idx - start + 1) 
 | 
			
		||||
        long_streaks = [x for x in streaks if x > 3]
 | 
			
		||||
        long_streaks = [x-1 for x in streaks if x > 4]
 | 
			
		||||
        return long_streaks
 | 
			
		||||
        
 | 
			
		||||
def get_records():
 | 
			
		||||
 
 | 
			
		||||
@@ -78,10 +78,12 @@
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    
 | 
			
		||||
    Furnace averaging {{ "%.0f" % (total_minutes/range_hours) }} minutes/hr ({{ total_minutes }} minutes total).
 | 
			
		||||
    Furnace averaging {{ "%.0f" % (total_minutes/range_hours) }} minutes/hour ({{ total_minutes }} minutes total).
 | 
			
		||||
 | 
			
		||||
    <div class='row' id='plotly-plot'></div>
 | 
			
		||||
 | 
			
		||||
    {{ debug }}
 | 
			
		||||
 | 
			
		||||
  </body>
 | 
			
		||||
      
 | 
			
		||||
  <footer>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user