Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Fix for issue in cases where divide by zero happens when no fan is detected #70

Merged
merged 1 commit into from
Jul 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WattmanGTK/GPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def get_currents(self):
raise KeyError
self.fan_speed = self.sensors['fan']['1']['input']['value']
self.fan_speed_rpm_utilisation = self.fan_speed / self.sensors['fan']['1']['max']['value']
except KeyError:
except (KeyError, ZeroDivisionError):
self.fan_speed_rpm_utilisation = None
self.fan_speed = 'N/A'

Expand Down
2 changes: 2 additions & 0 deletions WattmanGTK/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def add_available_signal(self, signals, Plotsignals, hwmonpath= "", subsystem =
subsystem = key
stop_recursion = False
if "path" in value:
if subsystem == "":
continue
if any(path_sensor_to_plot in value["path"] for path_sensor_to_plot in sensors_to_plot):
signallabel = value["path"][1:].split("_")[0]
signalmax = 0
Expand Down