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: thermalzones:
- name: GPU+SYSTEM - name: GPU+SYSTEM
hwmon: amdgpu hwmon: amdgpu
source: temp1_input source: amdgpu/temp1_input
factor: 1000 factor: 1000
fan: fan:
- it8686/pwm2 - it8686/pwm2

View File

@@ -22,7 +22,7 @@ class ThermalZone:
self.target = config["target"] self.target = config["target"]
self.hwname = config["hwmon"] self.hwname = config["hwmon"]
self.hwmap = hwmon_map 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() self.setup_pwm()
logging.getLogger("pyfan").info( logging.getLogger("pyfan").info(
@@ -129,7 +129,7 @@ class PyFan:
for name in names: for name in names:
hwmon = name.split("/")[-2] hwmon = name.split("/")[-2]
with open(name) as file: with open(name) as file:
hwname = file.read() hwname = file.read().strip()
self.hwmon_map[hwname] = hwmon self.hwmon_map[hwname] = hwmon