mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-20 09:12:05 +08:00
f5e5d688c3
version: sunnypilot v0.9.9 release date: 2025-03-18T06:26:39 master commit: 8e5b656e654a7694c22f2b0b7bee0802db02b4af
23 lines
687 B
Python
23 lines
687 B
Python
from openpilot.common.api.comma_connect import CommaConnectApi
|
|
|
|
|
|
class Api:
|
|
def __init__(self, dongle_id):
|
|
self.service = CommaConnectApi(dongle_id)
|
|
|
|
def request(self, method, endpoint, **params):
|
|
return self.service.request(method, endpoint, **params)
|
|
|
|
def get(self, *args, **kwargs):
|
|
return self.service.get(*args, **kwargs)
|
|
|
|
def post(self, *args, **kwargs):
|
|
return self.service.post(*args, **kwargs)
|
|
|
|
def get_token(self, expiry_hours=1):
|
|
return self.service.get_token(expiry_hours)
|
|
|
|
|
|
def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
|
|
return CommaConnectApi(None).api_get(endpoint, method, timeout, access_token, **params)
|