Giter Club home page Giter Club logo

Comments (5)

reagcz avatar reagcz commented on July 1, 2024 1

Sorry for taking so long to respond. Since the conservation mode is a firmware feature, changing the percentage it kicks in is not possible. You CAN change the max percentage in Lenovo Vantage, but this feature is only available on ThinkPads, not our puny IdeaPads.

As for the automatic switch, there's no way my program can tell when the battery reaches past a certain charge level. All I can do is to check the current percentage every few minutes. That would theoretically work without much of a performance impact and would be easy to implement.

The issue is, it would keep switching the charging on and off constantly, and I'm not sure that's good for the battery. But it's doable. Would this be an acceptable implementation @webdevs-pro?

from ideapadtoolkit.

mightytry avatar mightytry commented on July 1, 2024 1

I think it would be enough to just switch it on at 80%. Because when I charge mine and turn protection on at 80% it keeps the current charge and is not discharging the battery, insted using the connected external power.

from ideapadtoolkit.

idwowrack avatar idwowrack commented on July 1, 2024 1

@webdevs-pro
you could make a simple script to notify your self about the battery level limit (the bash code snippet).
if it reached the top threshold battery level, then manually you switch mode to the conservative one.

`#!/bin/bash

TOP_THRESHOLD=84
BOTTOM_THRESHOLD=36
STABILITY_DURATION=3 # Number of consecutive checks to consider battery level as stable (adjust as needed)
NOTIFIED=false

while true; do
charger_status=$(WMIC Path Win32_Battery Get BatteryStatus | grep -oE '[0-9]+')

# 1 means discharging, 2 means charging, 3 means fully charged, 4 means low
if [ "$charger_status" -eq 1 ] || [ "$charger_status" -eq 2 ]; then
    battery_level=$(WMIC Path Win32_Battery Get EstimatedChargeRemaining | grep -oE '[0-9]+')

    if [ "$battery_level" -ge "$TOP_THRESHOLD" ] && [ "$charger_status" -eq 2 ]; then
        if [ "$NOTIFIED" = false ]; then
            NOTIFIED=true
            initial_level=$battery_level
            stability_counter=0
            powershell.exe -ExecutionPolicy Bypass -File "./notify.ps1" -Title "Battery Level" -Message "Battery level has reached at the top threshold and please enable the conservative mode via Lenovo Vantage >> Device: Power menu." -AppLogoPath "C:\Users\LENOVO\OneDrive\Pictures\is-it-legal.png"
        fi

`

from ideapadtoolkit.

webdevs-pro avatar webdevs-pro commented on July 1, 2024 1

Hey @idwowrack, thanks!
I made similar thing but using AutoHotKey script and PowerBattery.dll. If charge reached 75% then script will switch mode to conservation and if battery level is below 70% it will switch to normal.

SetTimer, Tick, 10000
return

Tick() {
   batteryLevel := GetBatteryLevel()
   mode := GetMode()

   if (batteryLevel > 75 && mode != "Conservation") {
      RunWait, powershell.exe -Command "Set-Location -Path '%A_ScriptDir%'; Set-LenovoChargingMode Conservation",, Hide
      ShowBatteryStatus()
   } else if (batteryLevel <= 70 && mode != "Normal" && mode != "Rapid" ) {
      RunWait, powershell.exe -Command "Set-Location -Path '%A_ScriptDir%'; Set-LenovoChargingMode Normal",, Hide
      ShowBatteryStatus()
   }
}

This is part of my script

from ideapadtoolkit.

chikatambun avatar chikatambun commented on July 1, 2024

Looks like more promising using AHK for auto mode switching, @webdevs-pro
Could you gist the step by step for using the autoscript ?

from ideapadtoolkit.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.