LGSTrayBattery icon indicating copy to clipboard operation
LGSTrayBattery copied to clipboard

New Clone shows NaN%

Open Zenrage opened this issue 4 years ago • 1 comments

I have the new clone as I was trying to figure out how this works. It seems through debug trace it is not finding a Power Profile for my G502 Lightspeed or G915. I dont have my G933 turned on but I am sure it will probably not work with that.

I attempted to try and back trace where these power profiles come from with some google searching. I cant seem to figure out where we pull these hash tables to at least create one. I might just copy one that seems close to 100% at a certain voltage and rename it.

Zenrage avatar Apr 04 '22 05:04 Zenrage

So after digging around and attempting to learn whats going on, it seems that the power models werent there so it will show NaN. There is a small tool that gets the power model for your devices (Logitech) BUT for some reason it errors out because the xmls for G915 and G502 had -- in their comments

Fixed that, and then the WPID that the program gets is different then the saved xml files. Fixed that and viola! Only thing is it seems the G502 power model is off. I dont need pin point accuracy (it seems my battery can charge to 4.2 V and the power model stops at like 4.1? or something. So just inserted a line if its over 100% just display 100%. I was testing this when it was 100% fully charged.

To add a second icon i just copied the xaml task bar icon stuff and made a second one renamed and added '2' to the name so no conflicts. Then changed the binding to "other device" since this source only shows connected devices (love that!)" and so afaik it shows the device that is not selected. Yay! Having fun so far!

Then I wanted to change the icons. I spent some time drawing out a 100% icon for Light with Keyboard but then I am stuck at getting device type. I am using the code from the previous one in HIDdevices to try and get it but I am a hobby programmer and I am falling short a bit here.

Either way I am having fun and learning a lot. I never understood the VVMM stuff until I dug into your code. So enjoying the slow progress I am making doing my own edits to make it work.

What I would like it to do is eventually show the # of icons based on the # of devices I have connected which is usually 2, and up to 3 (Headset) to show battery level... I realize this is such a niche program but Ive been asking for this in their feedback for so long.

There are still things I dont understand how or why its done, or how it works (for example HIDdevices doesnt seem to be used) but figuring it out.

Zenrage avatar Apr 07 '22 14:04 Zenrage