wip
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user