mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-11-03 00:53:44 +08:00
@@ -1,5 +1,3 @@
|
||||
from collections.abc import Callable
|
||||
|
||||
from openpilot.selfdrive.ui.ui_state import UIState
|
||||
from cereal import messaging
|
||||
from openpilot.common.params import Params
|
||||
@@ -19,16 +17,8 @@ class UIStateSP(UIState):
|
||||
]
|
||||
self.sm = messaging.SubMaster(op_services + sp_services)
|
||||
|
||||
# Callbacks
|
||||
self._ui_update_callbacks: list[Callable[[], None]] = []
|
||||
|
||||
def add_ui_update_callback(self, callback: Callable[[], None]):
|
||||
self._ui_update_callbacks.append(callback)
|
||||
|
||||
def update(self) -> None:
|
||||
UIState.update(self)
|
||||
for callback in self._ui_update_callbacks:
|
||||
callback()
|
||||
|
||||
def _update_status(self) -> None:
|
||||
UIState._update_status(self)
|
||||
|
||||
Reference in New Issue
Block a user