Coder Social home page Coder Social logo

kentzo / power Goto Github PK

View Code? Open in Web Editor NEW
70.0 10.0 32.0 157 KB

Python module that allows you to get power and battery status of the system. Windows, Mac OS X, Linux

License: MIT License

Python 100.00%
python battery linux macos windows power-management

power's Introduction

Power

https://travis-ci.org/Kentzo/Power.svg?branch=master Updates

Crossplatform (Windows, Linux, Mac OS X, FreeBSD) python module to access power capabilities of the system.

  • Power source type: AC, Battery or UPS
  • Battery warning level: no warning (None), less than 22% of battery (Early), less than 10min (Final)
  • Time remaining estimate
  • Fault tolerant: if for some reason power capabilities cannot be extracted, falls back to AC
  • Support for multiple batteries
  • Power changes can be observed (Mac OS X only for now)
  • Very easy to extend to support new features or new systems

Examples

Until we expand the documentation please have a look in power/tests.py

power's People

Contributors

cederom avatar changwoo avatar danlipsitt avatar jnesselr avatar kentzo avatar luisggpina avatar martey avatar pyup-bot avatar stuaxo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

power's Issues

Initial Update

Hi ๐Ÿ‘Š

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! ๐Ÿค–

Faulty estimates for more than one battery (at least on Linux)

The problem here is, that if more than one battery is available, the estimated remaining time for the battery that currently isn't in use isn't considered at all.

It's basically the same as the acpi sample-output in the attached screenshot, just that the output of power is in minutes.
2016-06-08-023936_475x45_scrot

Problem importing module in macOS 10.13.3

Hi! I installed the module today, v1.4 but when I try to import it I'm getting the following error:

import power
Traceback (most recent call last):
File "", line 1, in
File "/Users/valentinschmidt/anaconda3/lib/python3.6/site-packages/power/init.py", line 28, in
from power.darwin import PowerManagement
File "/Users/valentinschmidt/anaconda3/lib/python3.6/site-packages/power/darwin.py", line 163, in
class PowerSourcesNotificationsObserver(NSObject):
objc.BadPrototypeError: Objective-C expects 1 arguments, Python argument has 2 arguments for <unbound selector addObserver of PowerSourcesNotificationsObserver at 0x107273370>

Can someone help me please?

Unable to find energy_now file on Linux

Hi, I've tried using this module on my Linux system with kernel version 4.1.6 and it hits a FileNotFoundError because the energy_now file doesn't exist for my battery. I do see a file in there called charge_now though. Do you know if this is due to a renaming in more recent kernel versions? If so, would you be interested in a pull-request that fixes this? Thanks!

State the license

Please state the license of this module in COPYING or LICENSE file. Thanks

Does not work with Python3

Python 3 has changed ctypes module's source code, the data type c_ubyte is not present under wintypes.c_ubyte. Instead it is under ctypes.c_ubyte. Need to make this compatible with python3

Short Tutorial for Windows and Linux

I am trying to use the module in a Python application for both Windows and Linux. Is it possible you gave short examples for the implementation. Thanks though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.