Files
sunnypilot/system/manager/sunnylink.py
T
DevTekVE 5d440cf62a Refactor Sunnylink integration and add dongle registration check
The Sunnylink integration has been refactored to improve handling of scenarios where Sunnylink is enabled but the dongle is not registered. Added checks for the registration status of the Sunnylink dongle and updated related defaults and UI indicators correspondingly. Additionally, moved the execution of the sunnylink.py script to the background during launch to prevent blocking other tasks.
2024-06-19 22:03:28 +02:00

27 lines
645 B
Python
Executable File

#!/usr/bin/env python3
from openpilot.common.api.sunnylink import SunnylinkApi
from openpilot.common.params import Params
from openpilot.common.spinner import Spinner
from openpilot.system.version import is_prebuilt
if __name__ == "__main__":
# spinner = Spinner()
extra_args = {}
if not Params().get_bool("SunnylinkEnabled"):
print("Sunnylink is not enabled. Exiting.")
# spinner.close()
exit(0)
if not is_prebuilt():
extra_args = {
"verbose": True,
"timeout": 60
}
sunnylink_id = SunnylinkApi(None).register_device(None, **extra_args)
print(f"SunnyLinkId: {sunnylink_id}")
# spinner.close()