-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed authentication check. Added ipmailer script to send mails when …
…public ip changes. Added phonecharger script. Added styling for the homepage.
- Loading branch information
Ankit Rajpoot
committed
Nov 29, 2018
1 parent
d25c1a4
commit acebf9b
Showing
7 changed files
with
65 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import smtplib | ||
import json | ||
import urllib.request | ||
|
||
config = {} | ||
ip = urllib.request.urlopen("https://api.ipify.org").read().decode("utf-8") | ||
|
||
try: | ||
with open("../config.json", "r") as configJson: | ||
config = json.load(configJson) | ||
finally: | ||
if ("wanip" in config) is False or config["wanip"] != ip: | ||
#Update IP | ||
urllib.request.urlopen("https://www.randomgarage.com/postip.php?ip=" + ip) | ||
config["wanip"] = ip | ||
|
||
with open("../config.json", "w") as configJson: | ||
json.dump(fp = configJson, obj = config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# | ||
# | ||
import gpiozero | ||
import time | ||
|
||
chargeRelay = gpiozero.OutputDevice(1, active_high = False, | ||
initial_value = False) | ||
|
||
while True: | ||
# Charge it for 3 hours | ||
chargeRelay.on() | ||
time.sleep(10800) | ||
# Switch off power for 20 minutes | ||
chargeRelay.off() | ||
time.sleep(1200) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters