Skip to content

Commit

Permalink
Honour main allsky settings for temperature unit
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-developer committed Dec 29, 2022
1 parent 909e6e7 commit 4f64118
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion allsky_pistatus/allsky_pistatus.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,18 @@ def pistatus(params, event):

vcgm = Vcgencmd()
temp = vcgm.measure_temp()
data['AS_CPUTEMP'] = str(temp)
temp = round(temp,1)
tempUnits = s.getSetting("temptype")
if tempUnits == 'B':
data['AS_CPUTEMP_C'] = str(temp)
temp = (temp * (9/5)) + 32
temp = round(temp,1)
data['AS_CPUTEMP_F'] = str(temp)
else:
if tempUnits == 'F':
temp = (temp * (9/5)) + 32
temp = round(temp,1)
data['AS_CPUTEMP'] = str(temp)

throttled = vcgm.get_throttled()
data['AS_THROTTLEDBINARY'] = str(throttled['raw_data'])
Expand Down

0 comments on commit 4f64118

Please sign in to comment.