nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
https://www.nvaccess.org/
Other
2.09k stars 631 forks source link

Give NVDA the ability to detect time until full charge. #6309

Open derekriemer opened 8 years ago

derekriemer commented 8 years ago

In windows ten, it is the case that windows can tell you how many minutes until a full charge. I'm not sure how, because https://msdn.microsoft.com/en-us/library/windows/desktop/aa373232(v=vs.85).aspx doesn't have this built in, and neither does another windows api. I might play with this and see if there's a way to bring this feature in to reportBatteryStatus, so it reports something like "On AC power, 20min until full charge".

STR:

  1. Discharge your computer to about 50%.
  2. Plug it in.
  3. press windows+b
  4. go to the battery status.

It should say something like "20 minutes until full charge" after some time being plugged in.

nromey commented 8 years ago

I'll have to look at the code for getting the battery status. I notice though that when you look in the system tree manually, it shows this information. There has to be a way. and agree, if the feature is not currently in NVDA, I think that this would be a useful one, and maybe, it's not something that would take a whole lot of work to make happen if the information is available somewhere, even if we access it via tixt in the system tray battery information icon.

derekriemer commented 8 years ago

I don't see it with system Power Info, but windows is getting it from somewhere. It could be calculating it manually.

nromey commented 8 years ago

I don't see anything in that function method. It looks like Windows, and Mac OSX for that matter, go through a calculating phase where they determine rate of charge based on current etc. and teh power acpi interface.

What you could do, and I'm not sure if I could make this happen every time would be to determine if (a) windows 10 was running. Then (b) if we're in windows 10 and AC was connected, the script does this already,then it would have to do the following.

Grab the button object in the system tray where it displays battery information. It would be clunky but you could grab time to charge from that button/system tray battery icon.

josephsl commented 8 years ago

Hi, if it can be found, I think an API-based method would be a bit better. Thanks.

From: nromey [mailto:notifications@github.com] Sent: Friday, August 26, 2016 5:17 PM To: nvaccess/nvda nvda@noreply.github.com Subject: Re: [nvaccess/nvda] Give NVDA the ability to detect time until full charge. (#6309)

I don't see anything in that function method. It looks like Windows, and Mac OSX for that matter, go through a calculating phase where they determine rate of charge based on current etc. and teh power acpi interface.

What you could do, and I'm not sure if I could make this happen every time would be to determine if (a) windows 10 was running. Then (b) if we're in windows 10 and AC was connected, the script does this already,then it would have to do the following.

Grab the button object in the system tray where it displays battery information. It would be clunky but you could grab time to charge from that button/system tray battery icon.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nvaccess/nvda/issues/6309#issuecomment-242882145 , or mute the thread https://github.com/notifications/unsubscribe-auth/AHgLkNmdw8sotw6d8dnSWDo-SJDrSrpLks5qj4HwgaJpZM4JuYgO .

ruifontes commented 8 years ago

The most strange thing is that sometimes the information appears in the system tray button and sometimes appears only the capacity percentage...

In this moment, in the systray appears the time remaining to full charge, 1 hour 20 minutes and in Insert+Shift+B is announced the capacity percentage... After writing the above sentence I was checking and in Systray appears only the percentage...

Rui

-----Mensagem Original----- De: nromey Data: 27 de agosto de 2016 01:16 Para: nvaccess/nvda Assunto: Re: [nvaccess/nvda] Give NVDA the ability to detect time until full charge. (#6309)

I don't see anything in that function method. It looks like Windows, and Mac OSX for that matter, go through a calculating phase where they determine rate of charge based on current etc. and teh power acpi interface.

What you could do, and I'm not sure if I could make this happen every time would be to determine if (a) windows 10 was running. Then (b) if we're in windows 10 and AC was connected, the script does this already,then it would have to do the following.

Grab the button object in the system tray where it displays battery information. It would be clunky but you could grab time to charge from that button/system tray battery icon.

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

derekriemer commented 8 years ago

Could this be done reliably fo multiple languages?

Sent from a mobile device. Please disregard errors as this is a smaller device.

On Aug 26, 2016, at 18:16, nromey notifications@github.com wrote:

I don't see anything in that function method. It looks like Windows, and Mac OSX for that matter, go through a calculating phase where they determine rate of charge based on current etc. and teh power acpi interface.

What you could do, and I'm not sure if I could make this happen every time would be to determine if (a) windows 10 was running. Then (b) if we're in windows 10 and AC was connected, the script does this already,then it would have to do the following.

Grab the button object in the system tray where it displays battery information. It would be clunky but you could grab time to charge from that button/system tray battery icon.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

LeonarddeR commented 8 years ago

I've looked into this twice, and twice stumbled upon impossibilities. My findings:

  1. The current approach with GetSystemPowerStatus can't retrieve time until full charge. There is one interesting parameter though, reserved1. That one now returns whether battery saver is on or off. So showing that could be implemented.
  2. The approach using the Win32_Battery WMI class.

Time required to fully charge the battery. This property is not supported. BatteryRechargeTime does not have a replacement property, and is now considered obsolete.

I'd like to vote against getting information from the system tray, as this is not at all reliable and quite error-prone, since the icon text will vary between languages.

Brian1Gaff commented 8 years ago

In my view this is going to be some piece of bespoke software in any given laptop, but from what people tell me this is not a perfect art. its a bit like file copy and stuff like that where the time estimated can seriously change over time. I have a washing machine that works like this with time to end of its cycle! Normally you cannot overcharge well designed laptops, so is this really needed? The estimated time till the battery warning is after all displayed. Brian

bglists@blueyonder.co.uk Sent via blueyonder. Please address personal email to:- briang1@blueyonder.co.uk, putting 'Brian Gaff' in the display name field. ----- Original Message ----- From: "derekriemer" notifications@github.com To: "nvaccess/nvda" nvda@noreply.github.com Sent: Friday, August 26, 2016 10:56 PM Subject: Re: [nvaccess/nvda] Give NVDA the ability to detect time until full charge. (#6309)

I don't see it with system Power Info, but windows is getting it from somewhere. It could be calculating it manually.

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/6309#issuecomment-242861553

nromey commented 8 years ago

I agree w the no system tray option. I found that if today items are rearranged, the approach fails. I think Windows probably samples battery percentages. Could one poll percentages in the background with the kernel method and mathematically calculate it. I'm not sure but it most likely wouldn't take too much processor work. I'm just not sure what the project policies are about events like that.

On Aug 27, 2016, at 4:46 AM, Brian1Gaff notifications@github.com wrote:

In my view this is going to be some piece of bespoke software in any given laptop, but from what people tell me this is not a perfect art. its a bit like file copy and stuff like that where the time estimated can seriously change over time. I have a washing machine that works like this with time to end of its cycle! Normally you cannot overcharge well designed laptops, so is this really needed? The estimated time till the battery warning is after all displayed. Brian

bglists@blueyonder.co.uk Sent via blueyonder. Please address personal email to:- briang1@blueyonder.co.uk, putting 'Brian Gaff' in the display name field. ----- Original Message ----- From: "derekriemer" notifications@github.com To: "nvaccess/nvda" nvda@noreply.github.com Sent: Friday, August 26, 2016 10:56 PM Subject: Re: [nvaccess/nvda] Give NVDA the ability to detect time until full charge. (#6309)

I don't see it with system Power Info, but windows is getting it from somewhere. It could be calculating it manually.

You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/nvaccess/nvda/issues/6309#issuecomment-242861553

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

derekriemer commented 7 years ago

@leonardder commented on Aug 27, 2016, 1:57 AM MDT:

I've looked into this twice, and twice stumbled upon impossibilities. My findings:

  1. The current approach with GetSystemPowerStatus can't retrieve time until full charge. There is one interesting parameter though, reserved1. That one now returns whether battery saver is on or off. So showing that could be implemented.
  2. The approach using the Win32_Battery WMI class.

Time required to fully charge the battery. This property is not supported. BatteryRechargeTime does not have a replacement property, and is now considered obsolete.

I'd like to vote against getting information from the system tray, as this is not at all reliable and quite error-prone, since the icon text will vary between languages.

Can you describe [2]

LeonarddeR commented 7 years ago
I played somewhat with the answer in

http://stackoverflow.com/questions/21083518/get-battery-status-using-wmi-in-python This uses win32com though, thus you have to run from source or in a stand alone interpreter to test.