This commit is contained in:
Your Name
2024-05-09 19:39:07 -05:00
parent 2041d6f89a
commit b586e93fe5

View File

@@ -434,24 +434,24 @@ def thermald_thread(end_event, hw_queue) -> None:
statlog.gauge("fan_speed_percent_desired", msg.deviceState.fanSpeedPercentDesired)
statlog.gauge("screen_brightness_percent", msg.deviceState.screenBrightnessPercent)
# report to server once every 10 minutes
rising_edge_started = should_start and not should_start_prev
if rising_edge_started or (count % int(600. / DT_TRML)) == 0:
dat = {
'count': count,
'pandaStates': [strip_deprecated_keys(p.to_dict()) for p in pandaStates],
'peripheralState': strip_deprecated_keys(peripheralState.to_dict()),
'location': (strip_deprecated_keys(sm["gpsLocationExternal"].to_dict()) if sm.alive["gpsLocationExternal"] else None),
'deviceState': strip_deprecated_keys(msg.to_dict())
}
cloudlog.event("STATUS_PACKET", **dat)
# # report to server once every 10 minutes
# rising_edge_started = should_start and not should_start_prev
# if rising_edge_started or (count % int(600. / DT_TRML)) == 0:
# dat = {
# 'count': count,
# 'pandaStates': [strip_deprecated_keys(p.to_dict()) for p in pandaStates],
# 'peripheralState': strip_deprecated_keys(peripheralState.to_dict()),
# 'location': (strip_deprecated_keys(sm["gpsLocationExternal"].to_dict()) if sm.alive["gpsLocationExternal"] else None),
# 'deviceState': strip_deprecated_keys(msg.to_dict())
# }
# cloudlog.event("STATUS_PACKET", **dat)
# save last one before going onroad
if rising_edge_started:
try:
params.put("LastOffroadStatusPacket", json.dumps(dat))
except Exception:
cloudlog.exception("failed to save offroad status")
# # save last one before going onroad
# if rising_edge_started:
# try:
# params.put("LastOffroadStatusPacket", json.dumps(dat))
# except Exception:
# cloudlog.exception("failed to save offroad status")
params.put_bool_nonblocking("NetworkMetered", msg.deviceState.networkMetered)