Skip to main content

LSPM - Laptop Smart Power Manager

Project description

LSPM - Laptop Smart Power Manager

The Laptop Smart Power Manager is a lightweight tool designed to autonomously manage laptop battery charge cycles with the help of a Smart Plug.

Description

When we are at home or at work, we may tend to leave our laptop plugged in and constantly charging. The problem of this practice is that it will damage the laptop battery prematurely.
To extend the battery life, it is recommended to unplug the charger before the battery reaches 100% and plug it in long before the battery is completely discharged. However, constantly keeping an eye on your computer's battery level turns out to be difficult in practice.

This is what the Laptop Smart Power Manager has to offer: it takes care of managing, for you, the charging cycles of your laptop in order to optimize its battery life.

To achieve this, LSPM needs an additional accessory: a Smart Plug.
The laptop must be plugged into the Smart Plug and both must be connected to the same local network:

Diagram of LSPM

The operating principle is quite simple:

  • if the battery level drops below 20%, LSPM tells the Smart Plug to turn on. The laptop then starts charging.
  • if the battery level reaches 100%, LSPM tells the Smart Plug to turn off. The laptop then stops charging.

Table of Contents

Installation

lspm can be installed using the package manager pip.

pip install lspm

Configuration

Prerequisites

Before using LSPM, your Smart Plug must be plugged in, configured and connected to the same local network as your laptop.

To work properly, LSPM needs some information about the Smart Plug:

  • IP Address
  • Username
  • Password

Command Line Interface

The easiest way is to use the command line tool lspm.

For the first use, enter the configuration parameters of your Smart Plug using the command lspm config:

$> lspm config
Enter the Smart Plug IP Address:
Enter a new username: 
Enter a new password: 

To get the available options for this command, run lspm config --help.

Usage

Command Line Interface

The easiest way is to use the command line tool lspm.

To start LSPM, run the command lspm start:

$> lspm start
Laptop Smart Power Manager started correctly
To stop it, press CTRL + C (on macOS, Command + .)

To stop it, press CTRL + C (or Command + . on macOS). Then, the following message should show up:

Laptop Smart Power Manager stopped successfully

Supported devices

TP-Link

  • Tapo
    • P100
    • P105 (not tested)
    • P110 (not tested)

Contributing

Contributions, issues and feature requests are always welcome!

License

Copyright © 2023 Imanol Setoain.
This project is MIT licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lspm-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

lspm-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file lspm-0.1.0.tar.gz.

File metadata

  • Download URL: lspm-0.1.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for lspm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c9fa1277d37a3aee191ce9ba1ec9075c8cf79a80fde4d0a36e30e16c4ce95d6
MD5 e29e0f4a2ecb8dd704913baaf8c14fd1
BLAKE2b-256 f57e67f6a806f0d1a8146f65386d36b7ad951e5472058932d28cf56a41fd2ec7

See more details on using hashes here.

File details

Details for the file lspm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: lspm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.12

File hashes

Hashes for lspm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e218fd18e389408f707140844e1b4ff8b5cc6bafe683e7b40dc794631b08f88
MD5 02d94ca7531a74189642efdb44c4277f
BLAKE2b-256 10eb965570d13e2457c7fcd29b210261535d711fcf9dfd4d89908a30905247c6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page