aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--py_relay.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/py_relay.py b/py_relay.py
index d492ab0..0c98d7f 100644
--- a/py_relay.py
+++ b/py_relay.py
@@ -8,7 +8,7 @@ Gets temperature from one wire sensor.
Attempts to keep temperature between given min and max.
Writes its own log as well as temperature data with timestamps to CSV file.
"""
-import os
+import getpass
import pigpio
from math import isnan
@@ -19,7 +19,7 @@ from csv import writer
__author__ = "Franek Ɓazarewicz-Muradyan"
__licence__ = "GPL"
__version__ = "0.0.1"
-__status__ = "Proof of concept"
+__status__ = "Development"
# One wire temperature sensor settings
W1_SENSOR_ID = '28-0517c1b121ff'
@@ -32,7 +32,7 @@ TEMPERATURE_MIN = 20
TEMPERATURE_MAX = 24
# TEMPERATURE_MIN = 28
# TEMPERATURE_MAX = 32
-USERNAME = os.getlogin()
+USERNAME = getpass.getuser()
LOGNAME = f'/var/log/{USERNAME}/shroombox.log'
DATA_FILE = f'/var/log/{USERNAME}/shroombox.csv'