×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    sysinfo.battery()

    Someone had posted in the Request Section of Sourceforge, if there was any function in PyS60 so that he can know if the battery was charging or not?

    So i thought of making solution by help of sysinfo.battery() itself, but it was frustrating to see that while charging if you print this command you just see the value stored previously.

    Like if battery level was 5 before charging then this command would just show you 5 while its charging.

    Any thing that can be done with this problem?
    IDEAS is all they need but still they think only Genius can give them that.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: sysinfo.battery()

    See this article, which says something like this:

    Code:
    from sysagent import *
    from esysagent import *
    
    status = charger_status()
    #Check charger Status..Plugged in, Connected, etc
     
    if status == ESAChargerConnected:
      text="Charger is connected" 
     
    elif status == EESAChargerDisconnected:
      text="Charger is disconnected"
     
    elif status == ESAChargerNotCharging:
      text="Charger is not charging"
     
    else:
      text="Charger unknown status
    
    print text

  3. #3
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: sysinfo.battery()

    Thanks Bogdan,

    That means this module is already made. No need to ponder upon it then. But still sysinfo.battery() isn't giving correct functionality, i wish i knew something about Symbian C++.
    IDEAS is all they need but still they think only Genius can give them that.

  4. #4
    Wiki Moderators
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,779

    Re: sysinfo.battery()

    Quote Originally Posted by shubhendra View Post
    Thanks Bogdan,

    That means this module is already made. No need to ponder upon it then. But still sysinfo.battery() isn't giving correct functionality, i wish i knew something about Symbian C++.
    Doesn't it work for you?

    Or it gives wrong reading?

    Do let us know.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Regular Contributor
    Join Date
    Dec 2007
    Location
    Tempe, AZ
    Posts
    411

    Re: sysinfo.battery()

    Hi croozeus

    While charging if you print sysinfo.battery() you just see the value stored previously.

    Like if battery level was 5 before charging then this command would just show you 5 while its charging.

    According to the PyS60 Library Reference release 1.4.3 final its written

    "Note: The returned value may be incorrect while the device is being charged"

    under battery().
    IDEAS is all they need but still they think only Genius can give them that.

  6. #6
    Wiki Moderators
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,779

    Re: sysinfo.battery()

    Quote Originally Posted by shubhendra View Post
    According to the PyS60 Library Reference release 1.4.3 final its written

    "Note: The returned value may be incorrect while the device is being charged"
    Ah, yes the status is old while charging!
    That is a limitation of the module, and as the documentation clearly mentions it, it can'nt be considered a Bug.
    Rest of the time the indication it shows is correct.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  7. #7
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Eindhoven, the Netherlands
    Posts
    187

    Re: sysinfo.battery()

    Quote Originally Posted by bogdan.galiceanu View Post
    See this article, which says something like this:

    Code:
    from sysagent import *
    from esysagent import *
    
    status = charger_status()
    #Check charger Status..Plugged in, Connected, etc
     
    if status == ESAChargerConnected:
      text="Charger is connected" 
     
    elif status == EESAChargerDisconnected:
      text="Charger is disconnected"
     
    elif status == ESAChargerNotCharging:
      text="Charger is not charging"
     
    else:
      text="Charger unknown status
    
    print text
    I was looking into sysagent because I also want to check charger status, and battery status more extensively than sysinfo offers.
    However, when I run the above code with a recent 1.2.0 sysagent for 3rd (as found on http://code.google.com/p/sixty/downloads/list ), the charger_status() call doesn't seem to exist. Looking at the test_sysagent.py, I can also not find any test for such functionality. I noticed that all calls now start with get_ prefix, and tried get_charger_status() but also no luck there...

    Regards,
    Mark.

  8. #8
    Registered User
    Join Date
    Nov 2006
    Posts
    568

    Re: sysinfo.battery()

    No Cyke, no charging

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •