sms
This commit is contained in:
parent
6e71cd6976
commit
d3d4565993
15
app/sms.py
15
app/sms.py
@ -6,9 +6,12 @@ import xmltodict
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from pushbullet import Pushbullet
|
# TODO: disabled api excess
|
||||||
|
#from pushbullet import Pushbullet
|
||||||
|
import subprocess
|
||||||
|
|
||||||
pb = Pushbullet(os.environ['PB_APIKEY'])
|
# TODO: disabled api excess
|
||||||
|
#pb = Pushbullet(os.environ['PB_APIKEY'])
|
||||||
|
|
||||||
pin = os.environ['PIN']
|
pin = os.environ['PIN']
|
||||||
|
|
||||||
@ -117,7 +120,10 @@ def getUnread(device_ip, headers):
|
|||||||
return unread
|
return unread
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
pb.push_note("SMS", "Starting SMS Huawei 3G")
|
# TODO: disabled api excess
|
||||||
|
#pb.push_note("SMS", "Starting SMS Huawei 3G")
|
||||||
|
ntfy_init_call = subprocess.run(["ntfy", "publish", "test", "Starting SMS Huawei 3G"])
|
||||||
|
print(ntfy_init_call.stdout)
|
||||||
while True:
|
while True:
|
||||||
device_ip = os.environ['GW_IP']
|
device_ip = os.environ['GW_IP']
|
||||||
if not isHilink(device_ip):
|
if not isHilink(device_ip):
|
||||||
@ -158,7 +164,8 @@ if __name__ == "__main__":
|
|||||||
f3.write(messages[i] + '\n')
|
f3.write(messages[i] + '\n')
|
||||||
# Pushbullet
|
# Pushbullet
|
||||||
print('# Notif pushbullet')
|
print('# Notif pushbullet')
|
||||||
pb.push_note("SMS", "From: %s\nDate: %s\n%s" % (messagesR[i]['Phone'], messagesR[i]['Date'], messagesR[i]['Content']))
|
# TODO: disabled api excess
|
||||||
|
#pb.push_note("SMS", "From: %s\nDate: %s\n%s" % (messagesR[i]['Phone'], messagesR[i]['Date'], messagesR[i]['Content']))
|
||||||
|
|
||||||
# NTFY
|
# NTFY
|
||||||
# TODO: exec ntfy publish
|
# TODO: exec ntfy publish
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user