fixed dict containing newlines

added missing alias in config
This commit is contained in:
2019-09-11 15:00:39 +02:00
parent 67ba3d8fca
commit 180ff99c4f
2 changed files with 4 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ loglevel: DEBUG
thermalzones:
- name: GPU+SYSTEM
hwmon: amdgpu
source: temp1_input
source: amdgpu/temp1_input
factor: 1000
fan:
- it8686/pwm2

View File

@@ -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__":