Skip to main content

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

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 - int
    • Returns
      • 1 if EC read/write is enabled.
      • 0 if 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.
    • Parameters
      • BYTE 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 - int
    • Returns - VALUE stored at BYTE ADDRESS fo memory provided.
    • Parameters
      • BYTE 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.
    • Parameters

      • PROFILE - 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.
    • Parameters
      • 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]]

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

ECTweaker-2.3.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

ECTweaker-2.3-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page