From 7d7352950268bd56eb1de2c692d02c9e288487f8 Mon Sep 17 00:00:00 2001 From: thoralmighty Date: Sat, 23 Mar 2024 17:38:04 +0100 Subject: [PATCH] Changed fan temperature thresholds --- downloads/ytdl-music.ps1 | 18 ++++++++++++++++++ fanctl.py | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 downloads/ytdl-music.ps1 diff --git a/downloads/ytdl-music.ps1 b/downloads/ytdl-music.ps1 new file mode 100644 index 0000000..711e0f5 --- /dev/null +++ b/downloads/ytdl-music.ps1 @@ -0,0 +1,18 @@ +# Requires yt-dlp; install with winget + +param ( + [string]$PLAYLISTURL, + [string]$LIBRARY_NAME = "Soundtracks", + [string]$TARGETPATH = "/mnt/data/media/" +) + +$DEFAULT_TARGET_PATH = "/mnt/data/media/" + +# Check if $PLAYLISTURL is empty +if (-not $PLAYLISTURL) { + Write-Output "Need to specify a playlist URL" + exit 1 +} + +# Use double quotes for variables within the yt-dlp command +yt-dlp -f 'ba' -x --audio-format mp3 $PLAYLISTURL -o "$TARGETPATH/$LIBRARY_NAME/%(playlist)s/%(title)s.%(ext)s" diff --git a/fanctl.py b/fanctl.py index 34a56f1..a4d3771 100755 --- a/fanctl.py +++ b/fanctl.py @@ -33,13 +33,13 @@ def set_speed(fan, speed): while 1: temp = get_temp() # Get the current CPU temperature - if temp > 70: # Check temperature threshhold, in degrees celcius + if temp > 60: # Check temperature threshhold, in degrees celcius set_speed(fan, 100) # Set fan duty based on temperature, 100 is max speed and 0 is min speed or off. - elif temp > 60: - set_speed(fan, 85) elif temp > 50: - set_speed(fan, 60) + set_speed(fan, 85) elif temp > 40: + set_speed(fan, 60) + elif temp > 35: set_speed(fan, 50) elif temp > 32: set_speed(fan, 45)