Skip to content

Commit

Permalink
Fix warnings for temperature sensors (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanusk authored Dec 6, 2019
1 parent ecbe32b commit f2f3f5f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion s_tui/sources/temp_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from __future__ import absolute_import

import warnings
import logging
from collections import OrderedDict
import psutil
Expand All @@ -31,6 +32,7 @@ class TempSource(Source):
THRESHOLD_TEMP = 80

def __init__(self, temp_thresh=None):
warnings.filterwarnings('ignore', '.*FileNotFound.*',)
if not hasattr(psutil, "sensors_temperatures"):
self.is_available = False
logging.debug("cpu temperature is not available from psutil")
Expand Down Expand Up @@ -120,4 +122,4 @@ def get_top(self):
top_temp = temp_minor.critical
except TypeError:
continue
return top_temp
return min(top_temp, 99)

0 comments on commit f2f3f5f

Please sign in to comment.