Code Monkey home page Code Monkey logo

cyberpower-shutdown-bot's Introduction

Cyberpower UPS Shutdown

Welcome to Cyberpower UPS Shutdown, a tool to help users immediately shutdown their Cyberpower UPS and computer and give the option to shedule (or not) the restore time of the UPS. With this app, you can avoid the need to set fixed restore times for each day of the week and you can decide the restore time in the moment that you want to turn off the computer. The app has a simple graphical user interface (GUI) made with PyQt and uses Selenium to automate the shutdown/restore process through the Powerpanel Business web interface.

How to Use

To use Cyberpower UPS Shutdown, you'll need to have the Cyberpower Powerpanel Business software installed on your system. (Note: This app does not work with the personal version of Powerpanel.)

Before running the app, you'll need to create a config.ini file in the root folder with the following structure:

[DEFAULT]

HOME_URL = http://localhost:3052/local/
SHUTDOWNMENU_URL = http://localhost:3052/local/ups_setting/scheduled_shutdown
USERNAME = admin
PASSWORD = admin

DEFAULT_RESTORE_TIME = 11:00

Be sure to fill in the USERNAME and PASSWORD fields with the ones you've set in the Powerpanel Business app. The DEFAULT_RESTORE_TIME field is the default time that will show in the GUI and can be changed.

To run the app, simply execute the mainGUI.py file using Python. The GUI will allow you to specify the restore time if desired.

  • If you choose to set a restore time and fill in the required field, the app will schedule the shutdown for the current time + 1min and set the restore time as specified.
  • If you leave the field blank, the UPS and computer will simply shutdown without setting a restore time.

Tech stack

  • Python
  • Selenium
  • PyQt (for the GUI)

Future Optimizations

  • Improve stability
  • Add error handling for cases where the Powerpanel Business web interface is not available or the login credentials are incorrect.
  • Attempt to make it work with the headless version of the webdriver
  • Add additional features to the GUI, such as a checkbox to decide if you want to set a restore time for the UPS or not.

Note

Be sure to save any important work before running this app, as the shutdown process will begin immediately.

Enjoy!

We hope this app makes it easier for you to schedule shutdowns for your Cyberpower UPS. Happy computing!

cyberpower-shutdown-bot's People

Contributors

rockyalife avatar

Watchers

 avatar

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.