-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (20 loc) · 797 Bytes
/
main.py
File metadata and controls
27 lines (20 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import json
from time import sleep
from solidgps import SolidGPS
# --- Configuration ---
USERNAME = "your@email.com" # replace with your Solid GPS account email
PASSWORD = "yourpassword" # replace with your Solid GPS account password
# ---------------------
gps = SolidGPS(username=USERNAME, password=PASSWORD)
if not gps.login():
raise SystemExit("Login failed — check credentials")
print()
# Fetch tracking data
print("Fetching tracking data...")
data = gps.get_tracking_data()
print(json.dumps(data, indent=2) if isinstance(data, (dict, list)) else data)
print(f"Battery: {gps.get_battery_status()}%")
# Example: refresh device info (battery, status, etc.) periodically
sleep(10)
gps.refresh()
print(f"Battery (refreshed): {gps.get_battery_status()}%")