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:
DevTekVE
2024-06-22 14:45:04 +02:00
parent 93286505e1
commit 696497c6e4
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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.