mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2025-01-09 17:33:47 +00:00
Add logging to the gateway detection process
This commit is contained in:
parent
cbb3a8f43b
commit
7ea5949fcf
1 changed files with 4 additions and 0 deletions
|
@ -15,8 +15,12 @@ GATEWAY = "22223333"
|
||||||
def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, bytes]:
|
def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, bytes]:
|
||||||
"""Forwards a registration request to the phone and returns the phone number, signature for the provided push token"""
|
"""Forwards a registration request to the phone and returns the phone number, signature for the provided push token"""
|
||||||
if gateway is None:
|
if gateway is None:
|
||||||
|
print("Requesting device MCC+MNC for gateway detection...")
|
||||||
mccmnc = requests.get(f"http://{PHONE_IP}:{API_PORT}/info").text
|
mccmnc = requests.get(f"http://{PHONE_IP}:{API_PORT}/info").text
|
||||||
|
print("MCC+MNC received! " + mccmnc)
|
||||||
|
print("Determining gateway...")
|
||||||
gateway = gateway_fetch.getGatewayMCCMNC(mccmnc)
|
gateway = gateway_fetch.getGatewayMCCMNC(mccmnc)
|
||||||
|
print("Gateway found! " + gateway)
|
||||||
if gateway is None:
|
if gateway is None:
|
||||||
print("Automatic gateway detection failed, switching to default...")
|
print("Automatic gateway detection failed, switching to default...")
|
||||||
gateway = GATEWAY
|
gateway = GATEWAY
|
||||||
|
|
Loading…
Reference in a new issue