updated view
This commit is contained in:
9
resurse vechi /collors info.txt
Normal file
9
resurse vechi /collors info.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
To update the colors to the specified values, we will convert the hex color codes to RGBA format (values between 0 and 1) and update the `server_box_color` property in the `HomeScreen` class.
|
||||
|
||||
Here are the RGBA equivalents of the provided hex colors:
|
||||
|
||||
- **Yellow (#FB8D14)**: `(0.984, 0.553, 0.078, 1)`
|
||||
- **Red (#E8083E)**: `(0.909, 0.031, 0.243, 1)`
|
||||
- **Green (#02864A)**: `(0.008, 0.525, 0.290, 1)`
|
||||
The RGBA equivalent of `#573CFA` is `(0.341, 0.235, 0.980, 1)`.
|
||||
|
||||
3
resurse vechi /info.txt
Normal file
3
resurse vechi /info.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
python -m venv track
|
||||
source track/bin/activate
|
||||
pip install -r reqirements.txt
|
||||
2381
resurse vechi /openapi.yaml
Normal file
2381
resurse vechi /openapi.yaml
Normal file
File diff suppressed because it is too large
Load Diff
41
resurse vechi /test_traccar_trip.py
Normal file
41
resurse vechi /test_traccar_trip.py
Normal file
@@ -0,0 +1,41 @@
|
||||
import requests
|
||||
|
||||
def get_device_route(server_url, token, device_id, from_time, to_time):
|
||||
"""
|
||||
Fetch all positions for a device in a time frame from Traccar server.
|
||||
"""
|
||||
url = f"{server_url}/reports/route"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Accept": "application/json"
|
||||
}
|
||||
params = {
|
||||
"deviceId": device_id,
|
||||
"from": from_time,
|
||||
"to": to_time
|
||||
}
|
||||
response = requests.get(url, headers=headers, params=params)
|
||||
if response.status_code == 200:
|
||||
try:
|
||||
positions = response.json()
|
||||
print(f"Retrieved {len(positions)} positions.")
|
||||
return positions
|
||||
except Exception as e:
|
||||
print(f"Error parsing JSON: {e}")
|
||||
print(response.text)
|
||||
return []
|
||||
else:
|
||||
print(f"Failed to fetch positions: {response.status_code} - {response.text}")
|
||||
return []
|
||||
|
||||
# Example usage:
|
||||
if __name__ == "__main__":
|
||||
# Use your actual Traccar API endpoint (not /reports/route)
|
||||
server_url = "https://gps.moto-adv.com/api"
|
||||
token = "SDBGAiEA4sNXvVhL8w_Jd-5oCiXAuS5La5yelCQemfNysZYItaMCIQDOkzaoWKHbNnbZJw9ruGlsvbp35d90x3EGOZLXW_Gls3sidSI6MSwiZSI6IjIwMjUtMDYtMDlUMjE6MDA6MDAuMDAwKzAwOjAwIn0"
|
||||
device_id = 1 # Replace with your device ID
|
||||
from_time = "2024-06-02T21:00:00Z"
|
||||
to_time = "2025-06-03T20:59:00Z"
|
||||
positions = get_device_route(server_url, token, device_id, from_time, to_time)
|
||||
for pos in positions:
|
||||
print(f"{pos['deviceTime']}: {pos['latitude']}, {pos['longitude']}")
|
||||
1
resurse vechi /token for testing.txt
Normal file
1
resurse vechi /token for testing.txt
Normal file
@@ -0,0 +1 @@
|
||||
SDBGAiEA4sNXvVhL8w_Jd-5oCiXAuS5La5yelCQemfNysZYItaMCIQDOkzaoWKHbNnbZJw9ruGlsvbp35d90x3EGOZLXW_Gls3sidSI6MSwiZSI6IjIwMjUtMDYtMDlUMjE6MDA6MDAuMDAwKzAwOjAwIn0
|
||||
Reference in New Issue
Block a user