-
Notifications
You must be signed in to change notification settings - Fork 0
overheat.py
This module provides a function to turn off all fans using the wmi
library.
To use the overheat
module, you need to import the wmi
library. You can do this by adding the following code at the beginning of your script:
import wmi
This function turns off all fans in the system. It uses the wmi
library to interact with the Windows Management Instrumentation (WMI) and control the fans.
import wmi
def turn_off_all_fans():
c = wmi.WMI()
for fan in c.Win32_Fan():
fan.SetSpeed(0)
The turn_off_all_fans()
function initializes the wmi
object, which represents the WMI service on the local machine. It then iterates over all the fans in the system using the Win32_Fan
class provided by the wmi
library. For each fan, it calls the SetSpeed(0)
method to set the fan speed to 0, effectively turning it off.
Make sure to call this function when needed to turn off all the fans in your system.
Here's an example of how you can use the turn_off_all_fans()
function:
import overheat
overheat.turn_off_all_fans()
In this example, the overheat
module is imported, and the turn_off_all_fans()
function is called to turn off all the fans in the system.
Please note that this code is specific to Windows systems due to its reliance on the WMI library.