From d6d0edac393a715560053f3b289f519d905147b6 Mon Sep 17 00:00:00 2001 From: eagle00789 Date: Tue, 17 Feb 2015 21:58:46 +0000 Subject: [PATCH] Logrotate fix and small DS18B20 sensor fix --- scripts/rotate.tpl | 3 ++- sensors/ds18b20.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/rotate.tpl b/scripts/rotate.tpl index 41d1b40..3392c08 100644 --- a/scripts/rotate.tpl +++ b/scripts/rotate.tpl @@ -4,4 +4,5 @@ dateext compress missingok - } \ No newline at end of file + copytruncate + } diff --git a/sensors/ds18b20.py b/sensors/ds18b20.py index 6d45211..14801ad 100644 --- a/sensors/ds18b20.py +++ b/sensors/ds18b20.py @@ -96,13 +96,18 @@ def read_temp(): equals_pos = lines[1].find('t=') if equals_pos != -1: temp_string = lines[1][equals_pos+2:] + logging.debug("DS18B20 Debug message: Temperature from file: %s" % temp_string) temp_c = float(temp_string) / 1000.0 + logging.debug("DS18B20 Debug message: Temperature after calculations:: %s" % temp_c) data.append(temp_c) temp.close() for i in range(len(data)): - chandata.append({"name": sens[i], + chandata.append({"name": "Sensor: " + sens[i], "mode": "float", - "kind": "Custom", + "unit": "Custom", "customunit": "C", + "LimitMode": 1, + "LimitMaxError": 40, + "LimitMaxWarning": 35, "value": float(data[i])}) return chandata