Fix numeric type issue
Convert integer to float before calculation.
This commit is contained in:
parent
abd94a47a2
commit
ee75784f3a
@ -44,7 +44,7 @@ def handleFanSpeed():
|
|||||||
#print("Fan MAX") # Uncomment for testing
|
#print("Fan MAX") # Uncomment for testing
|
||||||
# Caculate dynamic fan speed
|
# Caculate dynamic fan speed
|
||||||
else:
|
else:
|
||||||
step = (FAN_HIGH - FAN_LOW)/(MAX_TEMP - MIN_TEMP)
|
step = float(FAN_HIGH - FAN_LOW)/float(MAX_TEMP - MIN_TEMP)
|
||||||
temp -= MIN_TEMP
|
temp -= MIN_TEMP
|
||||||
setFanSpeed(FAN_LOW + ( round(temp) * step ))
|
setFanSpeed(FAN_LOW + ( round(temp) * step ))
|
||||||
#print(FAN_LOW + ( round(temp) * step )) # Uncomment for testing
|
#print(FAN_LOW + ( round(temp) * step )) # Uncomment for testing
|
||||||
|
Loading…
Reference in New Issue
Block a user