Skip to content

Commit 8389163

Browse files
committed
Add min, avg, max temperatures to report
1 parent 471e382 commit 8389163

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

tmon/tmon.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def report(self):
8787
self.eprint("\n\n===================")
8888
self.eprint("Temp Monitor Report:\n")
8989
self.plot(self.ds)
90-
self.eprint("\n{}".format(self.tf.name))
90+
self.eprint("\n {}".format(self.tf.name))
9191
self.eprint("===================")
9292

9393
def plot(self, ds):
@@ -110,5 +110,12 @@ def plot(self, ds):
110110
'minimum': minimum,
111111
'maximum': maximum,
112112
}))
113+
self.eprint('')
114+
min_val = round(min(self.ds), 1)
115+
avg_val = round(sum(self.ds) / len(self.ds), 1)
116+
max_val = round(max(self.ds), 1)
117+
self.eprint(" >> min: {} °C <<".format(min_val))
118+
self.eprint(" >> avg: {} °C <<".format(avg_val))
119+
self.eprint(" >> max: {} °C <<".format(max_val))
113120
else:
114-
self.eprint(" >> {} °C <<".format(ds[0]))
121+
self.eprint(" >> {} °C <<".format(round(ds[0], 1)))

0 commit comments

Comments
 (0)