mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2025-01-09 17:33:47 +00:00
Merge branch 'beeper:sms-registration' into sms-registration
This commit is contained in:
commit
c0e532ace2
1 changed files with 4 additions and 3 deletions
|
@ -29,8 +29,9 @@ def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str,
|
||||||
token = push_token.hex().upper()
|
token = push_token.hex().upper()
|
||||||
req_id = random.randint(0, 2**32)
|
req_id = random.randint(0, 2**32)
|
||||||
sms = f"REG-REQ?v=3;t={token};r={req_id};"
|
sms = f"REG-REQ?v=3;t={token};r={req_id};"
|
||||||
r = requests.get(f"http://{PHONE_IP}:{API_PORT}/register", params={"sms": sms, "gateway": gateway})
|
print("Sending message and waiting for response...")
|
||||||
|
r = requests.get(f"http://{PHONE_IP}:{API_PORT}/register", params={"sms": sms, "gateway": gateway}, timeout=16)
|
||||||
|
print("Received response from device!")
|
||||||
if no_parse:
|
if no_parse:
|
||||||
print("Now do the next part and rerun with --pdu")
|
print("Now do the next part and rerun with --pdu")
|
||||||
exit()
|
exit()
|
||||||
|
@ -117,4 +118,4 @@ def parse_pdu(r: str, req_id: int | None = None):
|
||||||
|
|
||||||
|
|
||||||
# if __name__ == "__main__":
|
# if __name__ == "__main__":
|
||||||
# trio.run(main)
|
# trio.run(main)
|
||||||
|
|
Loading…
Reference in a new issue