bootshorn better temp logging +
This commit is contained in:
parent
6f86abd997
commit
951fa63296
2 changed files with 7 additions and 2 deletions
|
@ -32,7 +32,12 @@ print(f"@{temperature_date}: {temperature}°C")
|
|||
|
||||
filename = temperature_date.strftime("%Y-%m-%d_00-00-00.000000%z") + ".log"
|
||||
logpath = os.path.join(TEMPERATURE_LOG_DIR, filename)
|
||||
now_utc = datetime.datetime.now(datetime.timezone.utc)
|
||||
|
||||
with open(logpath, "a+", newline="") as logfile:
|
||||
writer = csv.writer(logfile)
|
||||
writer.writerow([temperature_date.strftime('%Y-%m-%d_%H-%M-%S.%f%z'), temperature])
|
||||
writer.writerow([
|
||||
now_utc.strftime('%Y-%m-%d_%H-%M-%S.%f%z'), # current UTC time
|
||||
temperature_date.strftime('%Y-%m-%d_%H-%M-%S.%f%z'), # date of temperature reading
|
||||
temperature,
|
||||
])
|
|
@ -25,7 +25,7 @@ defaults = {
|
|||
'systemd-timers': {
|
||||
'bootshorn-temperature': {
|
||||
'command': '/opt/bootshorn/temperature',
|
||||
'when': '*:0/5',
|
||||
'when': '*:0/10',
|
||||
'working_dir': '/opt/bootshorn',
|
||||
'user': 'ckn',
|
||||
'group': 'ckn',
|
||||
|
|
Loading…
Reference in a new issue