aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerg <uinarf@autistici.org>2023-03-06 11:57:56 +0100
committererg <uinarf@autistici.org>2023-03-06 11:57:56 +0100
commit93ef2d3614455198d0117e99a5922e47e0461fd0 (patch)
tree27ad3adc2fe0d6ba932b0c755f8e99193da05506
parent49243f99c9570e9b069b23e630707b1566c8a358 (diff)
downloadPi_Temp_PID_Control-93ef2d3614455198d0117e99a5922e47e0461fd0.tar.gz
Pi_Temp_PID_Control-93ef2d3614455198d0117e99a5922e47e0461fd0.tar.bz2
Pi_Temp_PID_Control-93ef2d3614455198d0117e99a5922e47e0461fd0.zip
Change method for getting current user due to failure of os.getuser()
-rw-r--r--pi_temp_pid.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/pi_temp_pid.py b/pi_temp_pid.py
index a20f8b0..24b0428 100644
--- a/pi_temp_pid.py
+++ b/pi_temp_pid.py
@@ -3,6 +3,18 @@
"""
Module controling temperature with PID setting a MOSFET.
+
+#############################################
+# Flow #
+#############################################
+
+start logging, run sanity checks ->
+turn on relay ->
+enter a loop of given interval ->
+check temperature ->
+try to write temperature log ->
+calculate MOSFET value with PID >
+set calculated value on MOSFET
"""
__author__ = "Franek Ɓazarewicz-Muradyan"
@@ -10,18 +22,6 @@ __licence__ = "GPL"
__version__ = "0.0.1"
__status__ = "Proof of concept"
-#############################################
-# Flow #
-#############################################
-
-# start logging, run sanity checks ->
-# turn on relay ->
-# enter a loop of given interval ->
-# check temperature ->
-# try to write temperature log ->
-# calculate MOSFET value with PID >
-# set calculated value on MOSFET
-
import os
import sys
@@ -29,6 +29,7 @@ import time
import signal
import logging
import io
+import getpass
from pydantic import BaseSettings
try:
@@ -44,7 +45,7 @@ except ImportError as exception:
#############################################
# User:
-USERNAME = os.getlogin()
+USERNAME = getpass.getuser()
# Files: