ECTweaker Library for python allows users to read/write and control the EC of laptops, specially MSI!
Project description
ECTweaker
ECTweaker Library for python allows users to read/write and control the EC of laptops, specially MSI!
INSTALLATION
- pip install ectweaker
- If the above method doesn't work please install in a virtual environment and call it in scripts from the virtual environments only!
Preparing the EC to be read/write friendly
- Disable secure boot
- To check one of the example to use this code properly, visit https://github.com/YoCodingMonster/OpenFreezeCenter-Lite/tree/main and check
OpenFreezeCenter-Lite.pyfile
Updating
- pip install ECTweaker --upgrade
Functions
check()
- This prepare the OS for EC read/write functionality and reboots the system for the first time only.
Return Type- intReturns1if EC read/write is enabled.0if EC read/write is not enabled.
- Example
import os CHECK = ECT.check() if CHECK == 1: # your_script_here else: os.system("shutdown -r +1") print("Rebooting system within 1 min!\nPlease save all work before it happens!")
write(BYTE ADDRESS, VALUE)
- This will allow you to write any INTEGER value to BYTE ADDRESS.
ParametersBYTE ADDRESS- Hex address of the memory where VALUE needs to be written.VALUE- content which needs to be written at BYTE ADDRESS.
- Example
import ECTweaker as ECT ECT.write(0xd4, 121)
read(BYTE ADDRESS, SIZE)
- This will allow you to read INTEGER value from BYTE ADDRESS.
Return Type- intReturns- VALUE stored at BYTE ADDRESS fo memory provided.ParametersBYTE ADDRESS- Hex address of the first memory from where VALUE is retrived.SIZE- How many adjacent BYTE ADDRESS stores the complete VALUE.
- Example
import ECTweaker as ECT VALUE = ECT.read(0xd4, 1)
fan_profile(PROFILE, VALUES)
- This allows for MSI laptops with intel CPU to set Fan profiles.
-
ParametersPROFILE- Fan profile which needs to be, considered values are as follows.auto,advanced,cooler booster
ONOFF- This is a list of address and values which needs to be set in order to change the fan profile.- [[ADDRESS, VALUE ON],[COOLER BOOSTER ADDRESS, VALUE OFF]]
ADDRESS- This is the list of addresses for CPU and GPU fan speeds as [[CPU1, CPU2, CPU3, CPU4, CPU5, CPU6, CPU7], [GPU1, GPU2, GPU3, GPU4, GPU5, GPU6, GPU7]]SPEED- This is the list of speed percentages for CPU and GPU fans at set temps as [[CPU1, CPU2, CPU3, CPU4, CPU5, CPU6, CPU7], [GPU1, GPU2, GPU3, GPU4, GPU5, GPU6, GPU7]]
-
Example - Auto is turned on on MSI laptop with 11th gen processor and (Cooler Booster is being turned off as precaution)
import ECTweaker as ECT ECT.fan_profile("auto", ONOFF = [[0xd4, 141], [0x98, 2]], ADDRESS, SPEED)- Example - Cooler booster is being turned on
import ECTweaker as ECT ECT.fan_profile("auto", ONOFF = [0x98, 130]) -
speed_writer(ADDRESS, SPEED)
- Internal function used by
fan_profile(PROFILE, VALUES)function to set the fan speed curve.ParametersADDRESS- This is the list of addresses for CPU and GPU fan speeds as [[CPU1, CPU2, CPU3, CPU4, CPU5, CPU6, CPU7], [GPU1, GPU2, GPU3, GPU4, GPU5, GPU6, GPU7]]SPEED- This is the list of speed percentages for CPU and GPU fans at set temps as [[CPU1, CPU2, CPU3, CPU4, CPU5, CPU6, CPU7], [GPU1, GPU2, GPU3, GPU4, GPU5, GPU6, GPU7]]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ECTweaker-2.3.tar.gz.
File metadata
- Download URL: ECTweaker-2.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34de5015a24eb605a8d4edb1c65649597fa9c60df8f2cbb2907f7e40937eb24e
|
|
| MD5 |
9874b06cac08c94d15e0e4f5b23398be
|
|
| BLAKE2b-256 |
da58df57c7add04f1c751961bc99f0d2eabe7a110209caeba86a47634fb9c5db
|
File details
Details for the file ECTweaker-2.3-py3-none-any.whl.
File metadata
- Download URL: ECTweaker-2.3-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5554b8f69f6f0464ea24668aeea2e8042741070960670809a05065b50cd781f
|
|
| MD5 |
d455f1dad99ac917e4ff6baa691171ff
|
|
| BLAKE2b-256 |
0c3540f0e7c1113f323bf59bff060dba096d526437148f5cabd86f8ea5850d80
|