Skip to content

Commit 9addebb

Browse files
authored
Remove beta feature for release
1 parent 6d5e2f8 commit 9addebb

File tree

1 file changed

+3
-58
lines changed

1 file changed

+3
-58
lines changed

temp.sh

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -113,54 +113,29 @@ re_elem() {
113113
}
114114
loop_cmds() {
115115
get_temp
116-
case ${cur_t#-} in
117-
''|*[!0-9]*) cur_t=$ot ;;
118-
esac
119116
if [ "$cur_t" -ne "$ot" ]; then
120117
# Calculate difference and make sure it's positive
121118
if [ "$cur_t" -le "$ot" ]; then
122119
tdiff="$((ot-cur_t))"
123-
decrease="1"
124120
else
125121
tdiff="$((cur_t-ot))"
126-
decrease="0"
127122
fi
128-
if [ "$tdiff" -ge "$chd" ] || [ "$equation_mode" -eq "1" ] || [ "$smooth_decrease" -eq "1" ]; then # if the temperature difference is big enough or equation-mode is active
123+
if [ "$tdiff" -ge "$chd" ]; then
129124
if [ "$cur_t" -lt "$mnt" ]; then
130125
new_spd="0"; otl="-1"
131126
elif [ "$cur_t" -lt "$mxt" ]; then
132127
tl=0
133128
for arr_t in $tc; do
134-
if [ "$cur_t" -le "$((arr_t-2))" ]; then
129+
if [ "$cur_t" -le "$arr_t" ]; then
135130
break
136-
elif [ "$cur_t" -ge "$arr_t" ]; then
131+
else
137132
tl=$((tl+1))
138133
fi
139134
done
140135
if [ "$tl" -ne "$otl" ]; then
141136
arr="$fc"; n="$tl"; re_elem
142137
new_spd="$elem"; otl="$tl"
143138
fi
144-
if [[ "$equation_mode" -eq "1" ]]; then # if equation-mode is on
145-
eval equationWithTemp=$equation
146-
fanSpeed=$(printf "%.0f" $(bc <<< $equationWithTemp)) # calculate the needed fan speed and round to integer
147-
if [[ "$fanSpeed" -lt "100" && "$fanSpeed" -gt "0" ]]; then # check if calculated fan speed is between 0 and 100
148-
new_spd=$fanSpeed
149-
fi
150-
fi
151-
if [[ "$smooth_decrease" -eq "1" ]]; then # if smooth-decrease is on
152-
if [ "$decrease" -eq "1" ]; then # and temperature is decreasing
153-
if [ -z "$speedToDeclineFrom" ]; then # if speedToDeclineFrom is empty (e.g. in the first cycle of the script)
154-
speedToDeclineFrom="$new_spd"
155-
fi
156-
if [[ "$speedToDeclineFrom" -gt "$smooth_decrease_setpoint" && "$speedToDeclineFrom" -gt "0" ]]; then # if current fan speed is greater than setpoint
157-
speedToDeclineFrom=$((speedToDeclineFrom-1)) # decrease the fan-speed
158-
fi
159-
new_spd="$speedToDeclineFrom"
160-
else
161-
speedToDeclineFrom="$new_spd" # if temperature is not decreasing, update the value for next cycle
162-
fi
163-
fi
164139
else
165140
new_spd="100"
166141
fi
@@ -202,16 +177,10 @@ set_stuff() {
202177
chd="$check_diff1"
203178
mnt="$min_t"; mxt="$max_t"
204179
tc="$tcurve"; fc="$fcurve"
205-
equation=$equation1 # for fan1
206180
else
207181
chd="$check_diff2"
208182
mnt="$min_t2"; mxt="$max_t2"
209183
tc="$tcurve2"; fc="$fcurve2"
210-
equation=$equation2 # for fan2
211-
fi
212-
# check if equation_mode is being used
213-
if [[ "$equation_mode" == "1" ]]; then
214-
mxt=$equation_max # set the maximum temp, as tcurve is not being used in this case
215184
fi
216185
}
217186

@@ -244,30 +213,6 @@ arr="$tcurve2"; n="0"; re_elem
244213
if [ "$min_t2" -ge "$elem" ]; then
245214
prf "min_t2 is greater than the first value in the tcurve2!"; exit 1
246215
fi
247-
if [[ -z "$equation_mode" ]]; then
248-
prf "equation_mode is not set (can be 0 or 1)!"; exit 1
249-
fi
250-
if [[ "$equation_mode" == "1" && -z "$equation1" ]]; then
251-
prf "equation_mode is on, but equation1 is empty!"; exit 1
252-
fi
253-
if [[ "$equation_mode" == "1" && -z "$equation2" ]]; then
254-
prf "equation_mode is on, but equation2 is empty!"; exit 1
255-
fi
256-
if [[ "$equation_mode" == "1" && -z "$equation_max" ]]; then
257-
prf "equation_mode is on, but equation_max is empty!"; exit 1
258-
fi
259-
if [[ "$min_t" -ge "$equation_max" ]]; then
260-
prf "min_t is greater than equation_max!"; exit 1
261-
fi
262-
if [[ -z "$smooth_decrease" ]]; then
263-
prf "smooth_decrease is not set (can be 0 or 1)!"; exit 1
264-
fi
265-
if [[ "$smooth_decrease" == "1" && -z smooth_decrease_setpoint ]]; then
266-
prf "smooth_decrease is on, but smooth_decrease_setpoint is empty!"; exit 1
267-
fi
268-
if [[ "$smooth_decrease_setpoint" -gt "100" ]] || [[ "$smooth_decrease_setpoint" -lt "0" ]]; then
269-
prf "smooth_decrease_setpoint is out of range (can be 0 - 100)!"; exit 1
270-
fi
271216

272217
# Calculate some more values
273218
arr="$tcurve"; arr_size; arr="$tcurve"; n="$arr_len"; re_elem; max_t="$elem"

0 commit comments

Comments
 (0)