Skip to content

Fix battery state not updating #5212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ton-An
Copy link

@ton-An ton-An commented Apr 17, 2025

Description

The method responsible for updating the battery state only gets the actual battery info on it's first call. All subsequent calls of the method use that initial battery info. Resulting in the battery state not changing.

Checklist

  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Testing instructions (needs a laptop)

  • Enable pauseTabAutocompleteOnBattery in VSCode settings
  • Plug and unplug the laptop to observe the auto-completion pausing and resuming (this doesn’t happen in the production version)

@ton-An ton-An requested a review from a team as a code owner April 17, 2025 17:51
@ton-An ton-An requested review from RomneyDa and removed request for a team April 17, 2025 17:51
Copy link

netlify bot commented Apr 17, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 9891bdc
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/68013fa20a6aad000950bea7

@sestinj
Copy link
Contributor

sestinj commented Apr 17, 2025

@ton-An this was changed because it caused problems on certain operating systems. In fact, we are likely going to remove this feature in the near future. Is this something you have been relying on heavily, or were you mostly helping to clean up?

@ton-An
Copy link
Author

ton-An commented Apr 17, 2025

@sestinj This feature is pretty important for my use case, as I often work on battery and frequently switch between battery and AC.

Have you tried using si.powerShellStart() and si.powerShellRelease() as mentioned in systeminformation#616? According to the maintainer, that reduced the cpu usage drastically. In addition, updating the state (lets say) only once per minute could help a lot too.

Would you be open to exploring this? I’m happy to make the changes, but I don’t have a Windows machine to test on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants