Battery indicator function adding an extra 6 hours

So I’m trying to make a battery indicator widget that displays how long until expected battery discharge. My formula is

$tf(bi(fullempty), D’d’+h’h’+m’m’)$

What I’ve noticed is that the h token is adding an extra 6 hours to itself when comparing what it’s outputting to the android battery panel. I’ll attach screenshots.

This is the first screenshot. Because I’m a new user I have to post the other screenshot in a reply.

Not sure if this is a bug or if there’s something I can do to fix it. I’m trying to get it as close to Android’s reading as possible.

Here’s the second screenshot

Hi,

Please take a look at the attached screenshot of my post here.

Are those 2 lines the ones that you need?

Hope this helps.

:smiling_face::+1:

Not exactly. I’m trying to have it display how much time is left, not an estimate of the time when it’ll be done charging/discharging. It should say something like

24h43m Remaining

The problem is that the hours seems to be off. Maybe I’m just looking too much into it tho.

Hi,

Try this formula (see my screenshot).

Hope this helps.
:smiling_face::+1:

Another test I just made (see the screenshot) indicated me that the formula works normally, the time shown by the formula is quite the same as the one shown by the system’s battery into.

The formula:

1. The battery will be $ if(bi(charging)=0, "discharged", "charged")$
   in $tf(bi(fullempty), "h'h and' m'm'")$
2. The battery will be $ if(bi(charging)=0, "discharged", "charged")$
   in $tf(bi(fullempty)-dp())$

Hope this helps.
:smiling_face::+1:


1 Like