From 94ce6f1dd1808e7e6dedf0ecd61438723ca28ad8 Mon Sep 17 00:00:00 2001 From: MirceaDan Date: Sat, 1 Dec 2018 20:02:22 -0800 Subject: [PATCH] cannot compare number with None TypeError: '<' not supported between instances of 'float' and 'NoneType' --- src/octoprint/printer/estimation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/octoprint/printer/estimation.py b/src/octoprint/printer/estimation.py index 91bff26c6..4cab68473 100644 --- a/src/octoprint/printer/estimation.py +++ b/src/octoprint/printer/estimation.py @@ -220,20 +220,20 @@ class TimeEstimationHelper(object): @property def average_total(self): if not self._count: - return None + return -1 else: return self._sum_total / self._count @property def average_total_rolling(self): if not self._count or self._count < self._rolling_window: - return None + return -1 else: return sum(self._totals) / len(self._totals) @property def average_distance(self): if not self._count or self._count < self._rolling_window + 1: - return None + return -1 else: return sum(self._distances) / len(self._distances)