Kodi Community Forum

Full Version: System.BatteryLevel 0% on osx
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't get any reading for battery on OSX.

If I plug or unplug charging cable, I notice the info shows as busy, meaning something is read. But I get no result other than 0% ( or busy Wink )

CPU usage too is always 0% (but that might just be my macbook kickin' butts.)

ideas?

Image
For what it's worth, it does detect when the battery is about to run out, it sends a notification to XBMC. So atleast that part is working on 10.8.3.
(2013-03-27, 11:58)toiva Wrote: [ -> ]For what it's worth, it does detect when the battery is about to run out, it sends a notification to XBMC. So atleast that part is working on 10.8.3.

Yes I noticed that, that's why i wasn't expecting it to not work... Wink

I wanted to have battery level on HomePage though...
maybe float is needed?

line 341 in DarwinUtils.mm

float batteryLevel = [[UIDevice currentDevice] batteryLevel];

Code:
int DarwinBatteryLevel(void)
{
  float batteryLevel = 0;
#if defined(TARGET_DARWIN_IOS)
  if(!DarwinIsAppleTV2())
     float batteryLevel = [[UIDevice currentDevice] batteryLevel];
#else

blah blah blah

#endif
  return batteryLevel * 100;  
}

just guessing. Confused
well even my OE/Win7 reports 0% and i don't have a battery and just use normal power cable.
Sound something that could be fixed i guess
(2013-03-27, 14:06)Martijn Wrote: [ -> ]well even my OE/Win7 reports 0% and i don't have a battery and just use normal power cable.
Sound something that could be fixed i guess

sweet Thanks!!

also system.CPUUsage returns.. 0%.... Angel
can you create a ticket for that on trac? also refer to this thread.
i tend to forget as i can't access it here at workWink
trac ticket submitted.
update_

it does show 100% when battery is full.
(2013-03-27, 14:11)fastcolors Wrote: [ -> ]
(2013-03-27, 14:06)Martijn Wrote: [ -> ]well even my OE/Win7 reports 0% and i don't have a battery and just use normal power cable.
Sound something that could be fixed i guess

sweet Thanks!!

also system.CPUUsage returns.. 0%.... Angel

https://github.com/xbmc/xbmc/commit/981c...5c291cba34