-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
suggestion: improvements to battery status detection #386
Comments
With the way this is currently implemented, it's pretty difficult to realize. |
Please implement this. It will also help with the new Surface Laptop Studio's "smart charging" mode that tries to keep the battery level around 80% instead of fully charged. |
I am simultaneously surprised, and entirely unsurprised that Microsoft themselves don't know how to use their own battery management system correctly. Windows' battery indicator has two separate states:
Laptops that use smart charging correctly and don't mess stuff up use the "Plugged in, Not Plugged in" in combination with the others. For example, on my Lenovo laptop, as soon as the battery hits the designated percentage (60%), the battery status switches to "Plugged in - not charging", which is what it should be. And it stays that way. ADM reacts to that accordingly by doing nothing (because battery events do not trigger since it's still plugged in). Sadly, as I've said before, this is far from an easy fix as implementing a delay such that it works well and integrates with future infrastructure in Auto Dark Mode is quite the undertaking. The estimation of my "soon" in the earlier post is weeks to months. |
- event will still trigger mutliple times - theme will no longer switch unless AC status changes specifically
1. Concerning delaysDelaying is still a bit more complicated to figure out, as we must make sure a theme switch is only ever delayed (as in: users have to configure a delay) if there is precedence. For more info on that see section 2. The current draft on how to realize this looks something like this. 2. Concerning fluctuating battery charging status originating from battery protection mechanismsThere are apparently better ways to track the battery status, which in theory should greatly improve the behavior of the charge state detection, eliminating false-positive theme switches almost entirely for most users. It looks like switching over to PowerSourceKind events is an almost ideal solution. However, this is only available in the new Windows App SDK, which still does not work yet due to a regression with WinForms (which we use for the tray) and .NET6 with ARM deployment. So, we will have to wait until this is fixed in net6. Note: This may introduce unintended side-effects such as Auto Dark Mode POTENTIALY preventing sleep due to reacting to battery events, keeping the system from idling |
On my Lenovo laptop (ThinkBook 14+) it swtiches to dark mode when battery is full with charger connected. It is a small issue and I have turn this feature off and I'm just reporting it. |
I've pushed changes to the latest beta such that Auto Dark Mode now queries the power supply status instead of the battery discharge state. In theory that should resolve unwanted switches, |
Thank you very much for fixing this! I will check it out ASAP! |
Thanks for the effort for achieving this! |
@Gravifer Hmm yes that is true. Would you be able to provide a log file with debugging enabled that reproduces this scenario? That way I can analyze the dropout interval. |
Is the option to delay the "auto switch to dark mode" triggered by an "unplugged" Laptop/Surface still in progress? I do unplug and replug my Surface quite often. It would be nice if I could set a delay time t prevent constant switching of the theme. Some programs do not handle that as good as they should. |
Due to power line may be loose coupled or unstable, unplug and replug may happen frequently when device is shifted.
In this situation, when "enable dark mode when device is unplugged" is enabled, dark mode would be toggled again and again.
So I suggest adding a delay time (like 10 seconds or user defined time) instead of switching to dark mode immediately when device is unplugged (and light mode when back to plugged).
The text was updated successfully, but these errors were encountered: