Skip to content

Commit d6d0eda

Browse files
committed
Logrotate fix and small DS18B20 sensor fix
1 parent 72ec4a7 commit d6d0eda

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

scripts/rotate.tpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
dateext
55
compress
66
missingok
7-
}
7+
copytruncate
8+
}

sensors/ds18b20.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,18 @@ def read_temp():
9696
equals_pos = lines[1].find('t=')
9797
if equals_pos != -1:
9898
temp_string = lines[1][equals_pos+2:]
99+
logging.debug("DS18B20 Debug message: Temperature from file: %s" % temp_string)
99100
temp_c = float(temp_string) / 1000.0
101+
logging.debug("DS18B20 Debug message: Temperature after calculations:: %s" % temp_c)
100102
data.append(temp_c)
101103
temp.close()
102104
for i in range(len(data)):
103-
chandata.append({"name": sens[i],
105+
chandata.append({"name": "Sensor: " + sens[i],
104106
"mode": "float",
105-
"kind": "Custom",
107+
"unit": "Custom",
106108
"customunit": "C",
109+
"LimitMode": 1,
110+
"LimitMaxError": 40,
111+
"LimitMaxWarning": 35,
107112
"value": float(data[i])})
108113
return chandata

0 commit comments

Comments
 (0)