mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-25 11:52:20 +08:00
Update sunnylink error logging and status display
Updated the error logging in sunnylink.py to include the module name for clarity. In addition, adjusted the status display in sidebar.cc to shorten the "REGISTERING" status text for a cleaner user interface.
This commit is contained in:
@@ -124,7 +124,7 @@ class SunnylinkApi(BaseApi):
|
||||
self._status_update(f"Waiting {backoff}s before retry, Exception occurred during registration: [{str(e)}]")
|
||||
|
||||
with open('/data/community/crashes/error.txt', 'a') as f:
|
||||
f.write(f"{datetime.now()}: {str(e)}\n")
|
||||
f.write(f"[{datetime.now()}] sunnylink: {str(e)}\n")
|
||||
|
||||
backoff = min(backoff * 2, 60)
|
||||
time.sleep(backoff)
|
||||
|
||||
@@ -166,7 +166,7 @@ void Sidebar::updateState(const UIState &s) {
|
||||
|
||||
if (sunnylink_enabled && last_sunnylink_ping == 0) {
|
||||
// If sunnylink is enabled, but we don't have a dongle id, and we haven't received a ping yet, we are registering
|
||||
status = sl_dongle_id.has_value() ? tr("OFFLINE") : tr("REGISTERING");
|
||||
status = sl_dongle_id.has_value() ? tr("OFFLINE") : tr("REGIST...");
|
||||
color = sl_dongle_id.has_value() ? warning_color : progress_color;
|
||||
} else if (sunnylink_enabled) {
|
||||
// If sunnylink is enabled, we are considered online if we have received a ping in the last 80 seconds, else error.
|
||||
|
||||
Reference in New Issue
Block a user