update network type less frequently (#1108)

pull/1103/head^2
Adeeb 5 years ago committed by GitHub
parent c179b20c5e
commit 2cc0eb1ca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/thermald.py

@ -192,6 +192,8 @@ def thermald_thread():
if health is not None: if health is not None:
usb_power = health.health.usbPowerMode != log.HealthData.UsbPowerMode.client usb_power = health.health.usbPowerMode != log.HealthData.UsbPowerMode.client
# get_network_type is an expensive call. update every 3s
if (count % int(3. / DT_TRML)) == 0:
try: try:
network_type = get_network_type() network_type = get_network_type()
except subprocess.CalledProcessError: except subprocess.CalledProcessError:

Loading…
Cancel
Save