Skip to content

Commit

Permalink
Make TemperatureFilter compatible to Python2
Browse files Browse the repository at this point in the history
  • Loading branch information
hirschmann committed Dec 12, 2016
1 parent dc426f9 commit 4646451
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions brewapp/base/tempfilter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from collections import deque
import statistics as stat


class TemperatureFilter(object):
Expand All @@ -11,7 +10,7 @@ def __init__(self, maxViableDeviation=4):

def filterTemperature(self, temperature):
self.__deque.append(temperature)
median = stat.median(self.__deque)
median = sorted(self.__deque)[len(self.__deque)//2]
deviation = abs(median - temperature)

print("deq:" + str(self.__deque))
Expand Down

0 comments on commit 4646451

Please sign in to comment.