Hi,

I've been wondering for a while why I never see a full battery icon in the WPS for longer than a couple of minutes after recharging. Digging a bit into the WPS code (for %bl), I found the following lines:

                   int l = battery_level();
                   limit = MAX(limit, 2);
                   if (l > -1)
                   {
                       snprintf(buf, buf_size, "%d", l);
                       /* First enum is used for "unknown level". */
                       *intval = (limit - 1) * l / 100 + 1 + 1;
                   }

This means that the highest interval (full battery icon) is only returned for a level of 100, and 99 will already give you the second highest interval. Is this intentional? IMHO it would be more logical to spread the highest interval as the other ones, e.g. using:

                    int l = MIN(battery_level(), 99);
                    ...
                    *intval = limit * l / 100 + 1 + 1;

The volume display interval has the same issue btw.

Tobias

Reply via email to