Fix for unsupported turbo (#89)
* added possible fox for nit supported turbo boost
This commit is contained in:
parent
6d1cce4620
commit
da7ab203a1
|
@ -42,14 +42,18 @@ def turbo(value: bool = None):
|
|||
f = cpufreq
|
||||
inverse = False
|
||||
else:
|
||||
print("Error: cpu boost is not available")
|
||||
return None
|
||||
print("Warning: CPU turbo is not available")
|
||||
return False
|
||||
|
||||
if value is not None:
|
||||
if inverse:
|
||||
value = not value
|
||||
|
||||
try:
|
||||
f.write_text(str(int(value)) + "\n")
|
||||
except PermissionError:
|
||||
print("Warning: Changing CPU turbo is not supported. Skipping.")
|
||||
return False
|
||||
|
||||
value = bool(int(f.read_text().strip()))
|
||||
if inverse:
|
||||
|
|
Loading…
Reference in New Issue