Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/automatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def update_led_temperature(temp):
led_busy.release()


def update_status_file(status):
with open("/var/log/fanshim_status", "w") as f:
f.write(str(int(status)))


def get_cpu_temp():
t = psutil.sensors_temperatures()
for x in ['cpu-thermal', 'cpu_thermal']:
Expand Down Expand Up @@ -149,6 +154,8 @@ def held_handler():
if set_fan(enable):
last_change = t

update_status_file(enable)

if not args.noled:
update_led_temperature(t)

Expand Down