fixed dict containing newlines
added missing alias in config
This commit is contained in:
@@ -3,7 +3,7 @@ loglevel: DEBUG
|
||||
thermalzones:
|
||||
- name: GPU+SYSTEM
|
||||
hwmon: amdgpu
|
||||
source: temp1_input
|
||||
source: amdgpu/temp1_input
|
||||
factor: 1000
|
||||
fan:
|
||||
- it8686/pwm2
|
||||
|
6
pyfan.py
6
pyfan.py
@@ -22,7 +22,7 @@ class ThermalZone:
|
||||
self.target = config["target"]
|
||||
self.hwname = config["hwmon"]
|
||||
self.hwmap = hwmon_map
|
||||
self.alias_replace = re.compile(r'\b(' + '|'.join(re.escape(key) for key in self.hwmap.keys()) + r')\b')
|
||||
self.alias_replace = re.compile('|'.join(self.hwmap.keys()))
|
||||
self.setup_pwm()
|
||||
|
||||
logging.getLogger("pyfan").info(
|
||||
@@ -129,8 +129,8 @@ class PyFan:
|
||||
for name in names:
|
||||
hwmon = name.split("/")[-2]
|
||||
with open(name) as file:
|
||||
hwname = file.read()
|
||||
self.hwmon_map[hwname] = hwmon
|
||||
hwname = file.read().strip()
|
||||
self.hwmon_map[hwname] = hwmon
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user