diff --git a/app/sms.py b/app/sms.py index 40a8f35..7bd4983 100644 --- a/app/sms.py +++ b/app/sms.py @@ -6,9 +6,12 @@ import xmltodict import requests import json 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'] @@ -117,7 +120,10 @@ def getUnread(device_ip, headers): return unread 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: device_ip = os.environ['GW_IP'] if not isHilink(device_ip): @@ -158,7 +164,8 @@ if __name__ == "__main__": f3.write(messages[i] + '\n') # 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 # TODO: exec ntfy publish