Giter Site home page Giter Site logo

battery_charging_percentage_notifier's Introduction

Battery_charging_percentage_notifier

Python program to notify user to start charging or stop charging laptop battery

The python program is designed to create a message box when the battery of the user needs charging, or when the user must stop charging. This can help to limit capacity performance losing of the battery over time.

In general lithium ion batteries charge state should remain between 20-80 percent charge state for optimal battery life span.

The given code example will notify the user when the battery charge state if lower or equal to 25 percent, or when the charging state is higher or equal to 90 percent.

A message box is used for the notification. The message box will disappear when the user closes the message box, or when a battery charging state change is encountered (i.e. from charging to discharging or vice versa). Furthermore, the battery percentage as well the charging state are printed to a console.

Requirements

No third party package are required. Therefore no requirements.txt is added to this repository

Windows os only

Start application at start up

Create a batch file or an executable and place the file in the following directory: C:\Users<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Create an executable

A executable can be created using pyinstaller https://pyinstaller.readthedocs.io/en/stable/

python pyinstaller --onefile Battery_percentage.py

Create batch file

Open a text file and added the following line:
python "path\to\directory\file\Battery_percentage.py"
And change the extension from .txt to .bat

Battery state functions

Two function are provided within the Battery_percentage.py file which be used to get the battery percentage or the battery charging state:

  • get_battery_percentage
  • get_battery_charging_state

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.