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