mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
thermald: common min date (#28457)
* thermald: common min date * add to release files
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
import datetime
|
||||
|
||||
MIN_DATE = datetime.datetime(year=2023, month=6, day=1)
|
||||
+1
-1
@@ -260,7 +260,7 @@ struct tm get_time() {
|
||||
bool time_valid(struct tm sys_time) {
|
||||
int year = 1900 + sys_time.tm_year;
|
||||
int month = 1 + sys_time.tm_mon;
|
||||
return (year > 2021) || (year == 2021 && month >= 6);
|
||||
return (year > 2023) || (year == 2023 && month >= 6);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
|
||||
@@ -35,6 +35,7 @@ common/filter_simple.py
|
||||
common/stat_live.py
|
||||
common/spinner.py
|
||||
common/text_window.py
|
||||
common/time.py
|
||||
|
||||
common/kalman/.gitignore
|
||||
common/kalman/*
|
||||
|
||||
@@ -3,7 +3,7 @@ import os
|
||||
import datetime
|
||||
from panda import Panda
|
||||
|
||||
MIN_DATE = datetime.datetime(year=2023, month=4, day=1)
|
||||
from common.time import MIN_DATE
|
||||
|
||||
def set_time(logger):
|
||||
sys_time = datetime.datetime.today()
|
||||
|
||||
@@ -13,6 +13,7 @@ import psutil
|
||||
import cereal.messaging as messaging
|
||||
from cereal import log
|
||||
from common.dict_helpers import strip_deprecated_keys
|
||||
from common.time import MIN_DATE
|
||||
from common.filter_simple import FirstOrderFilter
|
||||
from common.params import Params
|
||||
from common.realtime import DT_TRML, sec_since_boot
|
||||
@@ -272,7 +273,7 @@ def thermald_thread(end_event, hw_queue):
|
||||
|
||||
# Ensure date/time are valid
|
||||
now = datetime.datetime.utcnow()
|
||||
startup_conditions["time_valid"] = (now.year > 2020) or (now.year == 2020 and now.month >= 10)
|
||||
startup_conditions["time_valid"] = now > MIN_DATE
|
||||
set_offroad_alert_if_changed("Offroad_InvalidTime", (not startup_conditions["time_valid"]))
|
||||
|
||||
startup_conditions["up_to_date"] = params.get("Offroad_ConnectivityNeeded") is None or params.get_bool("DisableUpdates") or params.get_bool("SnoozeUpdate")
|
||||
|
||||
Reference in New Issue
Block a user