added support for multiple temperature sources, highest wins
This commit is contained in:
@@ -11,11 +11,14 @@ interval: 1
|
|||||||
|
|
||||||
thermalzones:
|
thermalzones:
|
||||||
- name: GPU+SYSTEM
|
- name: GPU+SYSTEM
|
||||||
|
|
||||||
# This is your source temperature.
|
# This is your source temperature.
|
||||||
source: amdgpu/temp1_input
|
source: amdgpu/temp1_input
|
||||||
|
|
||||||
# This is most likely 1000 for your temp sensor as well.
|
# This is most likely 1000 for your temp sensor as well.
|
||||||
# If not, check what you sensor is outputing if you try to read from it.
|
# If not, check what you sensor is outputting if you try to read from it.
|
||||||
factor: 1000
|
factor: 1000
|
||||||
|
|
||||||
# Define all fans that this thermal zone is going to control.
|
# Define all fans that this thermal zone is going to control.
|
||||||
# There is no limit to how many fans one thermal zone can control.
|
# There is no limit to how many fans one thermal zone can control.
|
||||||
# You can have different limitations on your fans, for example:
|
# You can have different limitations on your fans, for example:
|
||||||
@@ -27,10 +30,12 @@ thermalzones:
|
|||||||
fan:
|
fan:
|
||||||
- it8686/pwm2
|
- it8686/pwm2
|
||||||
- amdgpu/pwm1: 170
|
- amdgpu/pwm1: 170
|
||||||
|
|
||||||
# This is your target temperature. This is one of the main control knobs. Set this to a comfortable temperature for
|
# This is your target temperature. This is one of the main control knobs. Set this to a comfortable temperature for
|
||||||
# your equipment. Don't set this as high as its max temperature allowance, since pid is gonna allow some overshooting.
|
# your equipment. Don't set this as high as its max temperature allowance, since pid is gonna allow some overshooting.
|
||||||
target: 60
|
target: 60
|
||||||
# For understanding PID please have a look at https://en.wikipedia.org/wiki/PID_controller. The forementioned page
|
|
||||||
|
# For understanding PID please have a look at https://en.wikipedia.org/wiki/PID_controller. The aforementioned page
|
||||||
# also explains what p, i and d stand for and what they do in detail. These are the second main control knobs.
|
# also explains what p, i and d stand for and what they do in detail. These are the second main control knobs.
|
||||||
# Simplified you can view them as:
|
# Simplified you can view them as:
|
||||||
# p = how heavy should pid weight difference in temperature
|
# p = how heavy should pid weight difference in temperature
|
||||||
|
10
pyfan.py
10
pyfan.py
@@ -73,6 +73,14 @@ class ThermalZone:
|
|||||||
d=int(d)))
|
d=int(d)))
|
||||||
|
|
||||||
def get_temp(self):
|
def get_temp(self):
|
||||||
|
if type(self.temp_source) is list:
|
||||||
|
max_temp = -1.0
|
||||||
|
for fan in self.temp_source:
|
||||||
|
if self.read_sysfs(fan):
|
||||||
|
max_temp = max(float(self.read_sysfs(fan)) * self.factor, max_temp)
|
||||||
|
|
||||||
|
return max_temp
|
||||||
|
else:
|
||||||
if self.read_sysfs(self.temp_source):
|
if self.read_sysfs(self.temp_source):
|
||||||
return float(self.read_sysfs(self.temp_source)) * self.factor
|
return float(self.read_sysfs(self.temp_source)) * self.factor
|
||||||
else:
|
else:
|
||||||
@@ -88,7 +96,7 @@ class ThermalZone:
|
|||||||
self.set_pwm_mode(list(target_fan.keys())[0], value)
|
self.set_pwm_mode(list(target_fan.keys())[0], value)
|
||||||
else:
|
else:
|
||||||
self.set_pwm_mode(target_fan, value)
|
self.set_pwm_mode(target_fan, value)
|
||||||
except FileNotFoundError as err:
|
except FileNotFoundError:
|
||||||
logging.getLogger("pyfan").warning("[%s] pwm not found."
|
logging.getLogger("pyfan").warning("[%s] pwm not found."
|
||||||
" Try reloading hwmon map..." % self.name)
|
" Try reloading hwmon map..." % self.name)
|
||||||
self.hwmap = self.pyfan.hwmap
|
self.hwmap = self.pyfan.hwmap
|
||||||
|
Reference in New Issue
Block a user