mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-03 08:41:47 +08:00
FrogPilot features - Register non-official devices
This commit is contained in:
Executable → Regular
+2
-1
@@ -3,6 +3,7 @@ import time
|
||||
import json
|
||||
import jwt
|
||||
import os
|
||||
import random, string
|
||||
from pathlib import Path
|
||||
|
||||
from datetime import datetime, timedelta
|
||||
@@ -76,7 +77,7 @@ def register(show_spinner=False) -> str | None:
|
||||
|
||||
if resp.status_code in (402, 403):
|
||||
cloudlog.info(f"Unable to register device, got {resp.status_code}")
|
||||
dongle_id = UNREGISTERED_DONGLE_ID
|
||||
dongle_id = ''.join(random.choices(string.ascii_lowercase + string.digits, k=16))
|
||||
else:
|
||||
dongleauth = json.loads(resp.text)
|
||||
dongle_id = dongleauth["dongle_id"]
|
||||
|
||||
Reference in New Issue
Block a user