Battery Maximum % based on presence of dock #141

Open
opened 2024-01-27 22:15:03 +00:00 by usernotfound · 2 comments

Describe what you'd like to be able to do

Ideally while my deck is docked at home, the battery is kept at a lower % to extend the life, however any time I plug it straight into a charger I want it to charge to 100% (eg, in a hotel, in the airport, etc)

  • Charge to 100% when USB power is applied
  • Limit battery maximum charge to a lower % when a dock is present.

Describe alternatives you've considered

I can just turn on and off the setting, but it's easy to forget and leave for the airport with 80% power. Then you plug it in in the hotel, and again you only end up with 80% power...

Anything else?

I don't know rust, or have a ton of free time to dig in now, but it looks relatively easy enough to add conditionals to charge_limit

However, I'm not seeing a lot of code I could crib from to know how you'd want me to handle detecting device attachment. I don't think it would have to identify the Steam dock or any various devices used for docking, per-se, but maybe there are other system devices that would work as a proxy for "is it docked?" like external display, keyboard+mouse, ethernet connectoi?"

The UI could be let you choose how you want it to detect when to limit, or just set the limit as it is now.

Limit Battery Charge (all the time)     [Toggle]
Limit Battery Charge (only when docked) [Toggle]
    With Dock             [Toggle]
    With External Display [Toggle]
    With Keyboard/Mouse   [Toggle]
Maximum Battery (%) [Slider]
### Describe what you'd like to be able to do Ideally while my deck is docked at home, the battery is kept at a lower % to extend the life, however any time I plug it straight into a charger I want it to charge to 100% (eg, in a hotel, in the airport, etc) * Charge to 100% when USB power is applied * Limit battery maximum charge to a lower % when a dock is present. ### Describe alternatives you've considered I can just turn on and off the setting, but it's easy to forget and leave for the airport with 80% power. Then you plug it in in the hotel, and again you only end up with 80% power... ### Anything else? I don't know rust, or have a ton of free time to dig in now, but it looks relatively easy enough to add conditionals to [`charge_limit`](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/main/backend/src/settings/steam_deck/battery.rs#L713) However, I'm not seeing a lot of code I could crib from to know how you'd want me to handle detecting device attachment. I don't think it would have to identify the Steam dock or any various devices used for docking, per-se, but maybe there are other system devices that would work as a proxy for "is it docked?" like external display, keyboard+mouse, ethernet connectoi?" The UI could be let you choose how you want it to detect when to limit, or just set the limit as it is now. ``` Limit Battery Charge (all the time) [Toggle] Limit Battery Charge (only when docked) [Toggle] With Dock [Toggle] With External Display [Toggle] With Keyboard/Mouse [Toggle] Maximum Battery (%) [Slider] ```
usernotfound added the
enhancement
label 2024-01-27 22:15:03 +00:00
Owner

It might be better to add a new power event variant and a new event trigger variant to handle setting charge mode/limit when that event fires.

How to display it in the UI is a whole other kettle of fish. I'm a bit hesitant to expose it at all, which is why it is currently only possible to achieve by editing the settings files. The UIs I can think of all seem too complex, but maybe that's a necessary evil that just needs to be hidden behind some sort of advanced options toggle.

It might be better to add a new [power event variant](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/dev/backend/src/settings/traits.rs#L15) and a new [event trigger variant](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/dev/backend/src/settings/steam_deck/battery.rs#L28) to handle setting charge mode/limit when that event fires. How to display it in the UI is a whole other kettle of fish. I'm a bit hesitant to expose it at all, which is why it is currently only possible to achieve by editing the settings files. The UIs I can think of all seem too complex, but maybe that's a necessary evil that just needs to be hidden behind some sort of advanced options toggle.

Made an account to suggest this then found this post :)

My Deck is on a dock 90% of the time, I'd love if it only charged to 80-85% while docked, but if I throw it directly on a charger (or even if I clicked a button that said "for the rest of this session, go ahead and charge fully) it would be nice to have a bypass for that setting.

For my use case, if anything else is connected (external display, other USB devices, etc) that isn't just a charger, then I'd like it to adhere to the reduced charge limit. But if I'm direct to a battery bank or a charger, then go ahead and charge to 100%.

Made an account to suggest this then found this post :) My Deck is on a dock 90% of the time, I'd love if it only charged to 80-85% while docked, but if I throw it directly on a charger (or even if I clicked a button that said "for the rest of this session, go ahead and charge fully) it would be nice to have a bypass for that setting. For my use case, if anything else is connected (external display, other USB devices, etc) that isn't just a charger, then I'd like it to adhere to the reduced charge limit. But if I'm direct to a battery bank or a charger, then go ahead and charge to 100%.
NGnius added the
help wanted
label 2024-02-04 19:16:26 +00:00
NGnius added this to the Genry milestone 2024-06-13 22:06:32 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: NG-SD-Plugins/PowerTools#141
No description provided.