mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
ui: Implement core device settings functionality with enhanced dynamic controls (#35507)
* implement device settings functionality with power controls * format * Update selfdrive/ui/layouts/settings/device.py Co-authored-by: Shane Smiskol <shane@smiskol.com> * Update selfdrive/ui/layouts/settings/device.py Co-authored-by: Shane Smiskol <shane@smiskol.com> * add comment back * add comments back --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
This commit is contained in:
@@ -66,6 +66,12 @@ class UIState:
|
||||
def engaged(self) -> bool:
|
||||
return self.started and self.sm["selfdriveState"].enabled
|
||||
|
||||
def is_onroad(self) -> bool:
|
||||
return self.started
|
||||
|
||||
def is_offroad(self) -> bool:
|
||||
return not self.started
|
||||
|
||||
def update(self) -> None:
|
||||
self.sm.update(0)
|
||||
self._update_state()
|
||||
|
||||
Reference in New Issue
Block a user