Files
sunnypilot/openpilot/common/api/__init__.py
T
Jason Wen 0a0c22270c Merge commit '35e78a9d9518855ec0dacec919e719624a28131f' into sync-20261016
# Conflicts:
#	.gitattributes
#	.gitignore
#	.gitmodules
#	opendbc_repo
#	openpilot/common/params_keys.h
#	openpilot/common/version.py
#	openpilot/selfdrive/car/card.py
#	openpilot/selfdrive/controls/lib/longitudinal_planner.py
#	openpilot/selfdrive/controls/plannerd.py
#	openpilot/selfdrive/controls/tests/test_latcontrol.py
#	openpilot/selfdrive/modeld/modeld.py
#	openpilot/selfdrive/pandad/pandad.py
#	openpilot/selfdrive/selfdrived/alerts_offroad.json
#	openpilot/selfdrive/selfdrived/selfdrived.py
#	openpilot/selfdrive/test/longitudinal_maneuvers/plant.py
#	openpilot/selfdrive/ui/layouts/settings/developer.py
#	openpilot/selfdrive/ui/layouts/settings/toggles.py
#	openpilot/selfdrive/ui/mici/layouts/home.py
#	openpilot/selfdrive/ui/mici/layouts/onboarding.py
#	openpilot/selfdrive/ui/mici/onroad/model_renderer.py
#	openpilot/selfdrive/ui/onroad/model_renderer.py
#	openpilot/selfdrive/ui/soundd.py
#	openpilot/selfdrive/ui/translations/app.pot
#	openpilot/selfdrive/ui/translations/app_de.po
#	openpilot/selfdrive/ui/translations/app_en.po
#	openpilot/selfdrive/ui/translations/app_es.po
#	openpilot/selfdrive/ui/translations/app_fr.po
#	openpilot/selfdrive/ui/translations/app_ja.po
#	openpilot/selfdrive/ui/translations/app_ko.po
#	openpilot/selfdrive/ui/translations/app_pt-BR.po
#	openpilot/selfdrive/ui/translations/app_th.po
#	openpilot/selfdrive/ui/translations/app_tr.po
#	openpilot/selfdrive/ui/translations/app_uk.po
#	openpilot/selfdrive/ui/translations/app_zh-CHS.po
#	openpilot/selfdrive/ui/translations/app_zh-CHT.po
#	openpilot/selfdrive/ui/ui_state.py
#	openpilot/system/hardware/chestnut/status.py
#	openpilot/system/manager/process_config.py
#	openpilot/system/ui/README.md
#	panda
#	tinygrad_repo
2026-10-18 14:43:46 -04:00

27 lines
885 B
Python

from openpilot.common.api.comma_connect import API_HOST as API_HOST, 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, payload_extra=None, expiry_hours=1):
return self.service.get_token(payload_extra, expiry_hours)
def api_get(endpoint, method='GET', timeout=None, access_token=None, session=None, **params):
return CommaConnectApi(None).api_get(endpoint, method, timeout, access_token, session, **params)
def get_key_pair() -> tuple[str, str, str] | tuple[None, None, None]:
return CommaConnectApi(None).get_key_pair()