Fix temperature fetching logic (was checking too often and causing false failures)

This commit is contained in:
2026-06-06 17:52:52 -04:00
parent c1287e628a
commit 66831e4833
+6 -1
View File
@@ -142,6 +142,10 @@ static void toggle_temp_warning_state(bool enable_warning) {
}
static void update_temperature() {
if (!s_pkjs_ready) {
return;
}
DictionaryIterator *out;
AppMessageResult result = app_message_outbox_begin(&out);
if (result != APP_MSG_OK) {
@@ -185,7 +189,7 @@ static void minute_handler(struct tm *tick_time, TimeUnits units_changed) {
if (!s_showing_date) {
update_minute_1();
}
if (s_pkjs_ready && tick_time->tm_min % 30 == 0) {
if (tick_time->tm_min % 30 == 0) {
update_temperature();
}
}
@@ -361,6 +365,7 @@ static void main_window_unload() {
static void inbox_received_handler(DictionaryIterator *iter, void *context) {
Tuple *ready_tuple = dict_find(iter, MESSAGE_KEY_PKJS_READY);
if (ready_tuple) {
s_pkjs_ready = true;
update_temperature();
return;
}