roguedbear / 12-hour-server Goto Github PK
View Code? Open in Web Editor NEWa python script to put the home "server" to sleep when wifi is disconnected at night, and wake up early the next day
License: GNU General Public License v3.0
a python script to put the home "server" to sleep when wifi is disconnected at night, and wake up early the next day
License: GNU General Public License v3.0
if the user exits the program (ctrl+c
) then delete the wake timers that might be there if the program was in sleep state.
If the wake timer was for a sufficiently large duration and the user puts the computer to sleep, the machine could wake up undesirably and deplete battery (if laptop).
as of now, i haven't been able to find a way to delete waketimers in linux, so if you face this specific issue just dont use sleep_interval
key in config.yaml
This will correct the program if someone manually sleeps the computer, and then wake it up at a later time, so PC knows time has changed, redo a phase check and run that phase.
doing this allows the program to correct its sleep timer since in case power goes out and laptop goes to sleep then:
doing so i could remove the "vigorous" checks that happen 10minutes before phase end time, and keep those checks uniform.
in case the router is a DHCP relay the /sys/class/net/wlo1/operstate
still shows up
and the computer wakes up even if the main router is down.
Since i want "connection to a network" being if the main router is up, pinging the default gateway seems to be the best option
since making changes is getting extremely tedious with worrying about if anything that works is gonna break or not
possible library to look into: freezegun
If you need to use the computer, currently the program will automatically make the computer go to sleep if you wake it up manually.
add a check if it detects multiple wakeups within 60seconds, stop the sleep functionality until a program restart (or a continue input)
Lines 1108 to 1119 in a2d2d5e
While this loop is running, the program would continue to spam alert_onTelegram
function until it sends a message, preventing it from moving on to a different phase when enough time passes and potentially keeping the laptop awake the entire night
instead it should:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.