mirror of
https://github.com/itsdave-de/fusionpbx_connect.git
synced 2025-05-06 15:45:15 +02:00
fix get format json
This commit is contained in:
parent
8705b6c65e
commit
e8108ed38e
@ -50,7 +50,8 @@ def get_trips_for_device():
|
|||||||
'deviceId': dev['id'],
|
'deviceId': dev['id'],
|
||||||
'from': (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%dT23:00:00.000Z'),
|
'from': (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%dT23:00:00.000Z'),
|
||||||
'to': datetime.now().strftime('%Y-%m-%dT22:59:59.999Z')
|
'to': datetime.now().strftime('%Y-%m-%dT22:59:59.999Z')
|
||||||
}
|
},
|
||||||
|
headers={'Accept': 'application/json'}
|
||||||
)
|
)
|
||||||
trips_response.raise_for_status()
|
trips_response.raise_for_status()
|
||||||
except requests.HTTPError as e:
|
except requests.HTTPError as e:
|
||||||
@ -58,6 +59,8 @@ def get_trips_for_device():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
frappe.throw(f"Error fetching trips: {e}")
|
frappe.throw(f"Error fetching trips: {e}")
|
||||||
|
|
||||||
|
print(trips_response.text)
|
||||||
|
|
||||||
#if len(trips_response.json()) > 0:
|
#if len(trips_response.json()) > 0:
|
||||||
# for debug in trips_response.json():
|
# for debug in trips_response.json():
|
||||||
# print(f"Distance: {debug['distance']} | Average Speed: {debug['averageSpeed']}")
|
# print(f"Distance: {debug['distance']} | Average Speed: {debug['averageSpeed']}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user