Open vladns opened 11 months ago
I may suggest you the following options:
You may try adding the hddtemp's --quiet
option, like this, although I'm not sure that it would work in this case:
diff --git a/src/afancontrol/temp/hdd.py b/src/afancontrol/temp/hdd.py
index b554959..1cdfba7 100644
--- a/src/afancontrol/temp/hdd.py
+++ b/src/afancontrol/temp/hdd.py
@@ -98,5 +98,5 @@ class HDDTemp(Temp):
def _call_hddtemp(self) -> str:
# `disk_path` might be a glob, so it has to be executed with a shell.
- shell_command = "%s -n -u C -- %s" % (self._hddtemp_bin, self._disk_path)
+ shell_command = "%s --quiet -n -u C -- %s" % (self._hddtemp_bin, self._disk_path)
return exec_shell_command(shell_command, timeout=10)
type = exec
kind of temperature config instead of type = hdd
.diff --git a/src/afancontrol/exec.py b/src/afancontrol/exec.py
index 482541f..325fac7 100644
--- a/src/afancontrol/exec.py
+++ b/src/afancontrol/exec.py
@@ -29,12 +29,12 @@ def exec_shell_command(shell_command: str, timeout: int = 5) -> str:
)
out = p.stdout.decode("ascii")
err = p.stderr.decode().strip()
- if err:
- logger.warning(
- "Shell command '%s' executed successfully, but printed to stderr:\n%s",
- shell_command,
- err,
- )
+ # if err:
+ # logger.warning(
+ # "Shell command '%s' executed successfully, but printed to stderr:\n%s",
+ # shell_command,
+ # err,
+ # )
return out
except subprocess.CalledProcessError as e:
ec = e.returncode
The log is filled with messages like these:
If you comment out the option “logfile = /var/log/afancontrol.log”, it stops writing to this file, but still writes to the system log.