Skip to content

Commit 4f64118

Browse files
Honour main allsky settings for temperature unit
1 parent 909e6e7 commit 4f64118

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

allsky_pistatus/allsky_pistatus.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,18 @@ def pistatus(params, event):
8585

8686
vcgm = Vcgencmd()
8787
temp = vcgm.measure_temp()
88-
data['AS_CPUTEMP'] = str(temp)
88+
temp = round(temp,1)
89+
tempUnits = s.getSetting("temptype")
90+
if tempUnits == 'B':
91+
data['AS_CPUTEMP_C'] = str(temp)
92+
temp = (temp * (9/5)) + 32
93+
temp = round(temp,1)
94+
data['AS_CPUTEMP_F'] = str(temp)
95+
else:
96+
if tempUnits == 'F':
97+
temp = (temp * (9/5)) + 32
98+
temp = round(temp,1)
99+
data['AS_CPUTEMP'] = str(temp)
89100

90101
throttled = vcgm.get_throttled()
91102
data['AS_THROTTLEDBINARY'] = str(throttled['raw_data'])

0 commit comments

Comments
 (0)