mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-23 06:52:07 +08:00
update network type less frequently (#1108)
This commit is contained in:
@@ -192,10 +192,12 @@ def thermald_thread():
|
||||
if health is not None:
|
||||
usb_power = health.health.usbPowerMode != log.HealthData.UsbPowerMode.client
|
||||
|
||||
try:
|
||||
network_type = get_network_type()
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
# get_network_type is an expensive call. update every 3s
|
||||
if (count % int(3. / DT_TRML)) == 0:
|
||||
try:
|
||||
network_type = get_network_type()
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
|
||||
msg.thermal.freeSpace = get_available_percent(default=100.0) / 100.0
|
||||
msg.thermal.memUsedPercent = int(round(psutil.virtual_memory().percent))
|
||||
|
||||
Reference in New Issue
Block a user