Page 1 of 1

How to format the Battery_percentage for Speech/Notific.

Posted: 27 Nov 2016 02:58
by husky
I'm struggling to find an example of how to display the battery_percentage.

I also tried with Speech Output but it just reads back the text. Can't make it "tell" the numeric value for the percentage.

I'd like to have real life example to guide me but could not find any, except one in XML. Doesn't help me at all.

I'll appreciate any help.

Re: How to format the Battery_percentage for Speech/Notific.

Posted: 27 Nov 2016 19:05
by P-chu
Hi husky,

This site's Help > "Creating a Custom Widget" uses the battery level as part of its example. It used the trigger "Battery Level", but there is a condition equivalent, which I assume is what you have tried or looked at. Both trigger and condition returns a variable, battery_level, which is a percentage value, and all you need to do is output it with a percentage sign (you could use one of the notification actions, or the widget example). In either trigger or condition, you will want the settings to be "higher than" and the percentage bar to the lowest possible level so it activates at each change of the battery power higher than 0%.

Hope this helps.

Re: How to format the Battery_percentage for Speech/Notific.

Posted: 28 Nov 2016 07:12
by husky
Hello P-chu

Thanks for the reply.

Your reply sure helped. Problem solved