Skip to content

Commit d25c433

Browse files
committed
November 28th, 2025 Update
1 parent aac7095 commit d25c433

File tree

17 files changed

+68
-50
lines changed

17 files changed

+68
-50
lines changed
-24 KB
Loading
-77.8 KB
Loading
-26.5 KB
Loading
738 KB
Loading
173 KB
Loading
-746 KB
Binary file not shown.

frogpilot/controls/frogpilot_card.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def __init__(self, CP, FPCP):
3333
def handle_button_event(self, sm, frogpilot_toggles, key):
3434
if sm["carControl"].longActive and getattr(frogpilot_toggles, f"experimental_mode_via_{key}"):
3535
self.handle_experimental_mode(sm, frogpilot_toggles)
36-
elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"force_coast_via{key}"):
36+
elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"force_coast_via_{key}"):
3737
self.force_coast = not self.force_coast
38-
elif getattr(frogpilot_toggles, f"pause_lateral_via{key}"):
38+
elif getattr(frogpilot_toggles, f"pause_lateral_via_{key}"):
3939
self.pause_lateral = not self.pause_lateral
40-
elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"pause_longitudinal_via{key}"):
40+
elif sm["carControl"].longActive and getattr(frogpilot_toggles, f"pause_longitudinal_via_{key}"):
4141
self.pause_longitudinal = not self.pause_longitudinal
42-
elif getattr(frogpilot_toggles, f"traffic_mode_via{key}"):
42+
elif getattr(frogpilot_toggles, f"traffic_mode_via_{key}"):
4343
self.traffic_mode_enabled = not self.traffic_mode_enabled
4444

4545
def handle_experimental_mode(self, sm, frogpilot_toggles):

frogpilot/controls/lib/weather_checker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def make_request():
153153
try:
154154
self.api_3_calls += 1
155155
response = self.session.get("https://api.openweathermap.org/data/3.0/onecall", params=params, timeout=10)
156-
if response.status_code == 429:
156+
157+
if response.status_code in (401, 403, 429):
157158
fallback_params = params.copy()
158159
fallback_params.pop("exclude", None)
159160
self.api_25_calls += 1

frogpilot/frogpilot_process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def frogpilot_thread():
5858
"frogpilotSelfdriveState", "frogpilotModelV2", "frogpilotOnroadEvents"],
5959
poll="modelV2")
6060

61-
params = Params()
62-
params_cache = Params(cache=True)
63-
params_memory = Params(memory=True)
61+
params = Params(return_defaults=True)
62+
params_cache = Params(cache=True, return_defaults=True)
63+
params_memory = Params(memory=True, return_defaults=True)
6464

6565
frogpilot_variables = FrogPilotVariables()
6666
theme_manager = ThemeManager(params, params_memory)

frogpilot/ui/qt/offroad/longitudinal_settings.cc

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -434,27 +434,44 @@ FrogPilotLongitudinalPanel::FrogPilotLongitudinalPanel(FrogPilotSettingsWindow *
434434
weatherKeyControl->setVisibleButton(1, true);
435435
}
436436
}
437-
} else {
437+
} else if (id == 1) {
438438
weatherKeyControl->setValue(tr("Testing..."));
439439

440-
QString key = QString::fromStdString(params.get("WeatherToken"));
441-
QString url = QString("https://api.openweathermap.org/data/2.5/weather?lat=42.4293&lon=-83.9850&appid=%1").arg(key);
440+
QString key = QString::fromStdString(params.get("WeatherToken")).trimmed();
441+
QString url30 = QString("https://api.openweathermap.org/data/3.0/onecall?lat=42.4293&lon=-83.9850&exclude=current,minutely,hourly,daily,alerts&appid=%1").arg(key);
442442

443-
QNetworkRequest request(url);
443+
QNetworkRequest request(url30);
444444
QNetworkReply *reply = networkManager->get(request);
445-
connect(reply, &QNetworkReply::finished, [=]() {
446-
weatherKeyControl->setValue("");
445+
QObject::connect(reply, &QNetworkReply::finished, this, [=]() {
446+
reply->deleteLater();
447447

448-
QString message;
449448
if (reply->error() == QNetworkReply::NoError) {
450-
message = tr("Key is valid!");
451-
} else if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 401) {
452-
message = tr("Invalid key!");
449+
weatherKeyControl->setValue("");
450+
ConfirmationDialog::alert(tr("Key is valid!"), this);
451+
return;
452+
}
453+
454+
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
455+
if (status == 401 || status == 403) {
456+
QString url25 = QString("https://api.openweathermap.org/data/2.5/weather?lat=42.4293&lon=-83.9850&appid=%1").arg(key);
457+
458+
QNetworkRequest request25(url25);
459+
QNetworkReply *reply25 = networkManager->get(request25);
460+
QObject::connect(reply25, &QNetworkReply::finished, this, [=]() {
461+
reply25->deleteLater();
462+
463+
weatherKeyControl->setValue("");
464+
if (reply25->error() == QNetworkReply::NoError) {
465+
ConfirmationDialog::alert(tr("Your key is valid for version 2.5, but version 3.0 is highly recommended! Please subscribe to the \"One Call API 3.0\" plan!"), this);
466+
} else {
467+
int status25 = reply25->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
468+
ConfirmationDialog::alert(tr("Invalid key! (Error: %1)").arg(status25), this);
469+
}
470+
});
453471
} else {
454-
message = tr("An error occurred: %1").arg(reply->errorString());
472+
weatherKeyControl->setValue("");
473+
ConfirmationDialog::alert(tr("An error occurred: %1").arg(reply->errorString()), this);
455474
}
456-
ConfirmationDialog::alert(message, this);
457-
reply->deleteLater();
458475
});
459476
}
460477
});

0 commit comments

Comments
 (0)