Log modem temps on Tici (#22281)

* log max modem temp

* not sure what happened here

* fix this

* make modem temps a list

* this is not needed

Co-authored-by: Comma Device <device@comma.ai>
pull/22294/head
Robbe Derks 2021-09-21 14:40:05 +02:00 committed by GitHub
parent 02825585fb
commit 6117c7ce81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 0 deletions

View File

@ -122,6 +122,10 @@ class HardwareBase:
def get_modem_version(self):
pass
@abstractmethod
def get_modem_temperatures(self):
pass
@abstractmethod
def initialize_hardware(self):
pass

View File

@ -389,6 +389,10 @@ class Android(HardwareBase):
def get_modem_version(self):
return None
def get_modem_temperatures(self):
# Not sure if we can get this on the LeEco
return []
def initialize_hardware(self):
pass

View File

@ -92,6 +92,9 @@ class Pc(HardwareBase):
def get_modem_version(self):
return None
def get_modem_temperatures(self):
return []
def initialize_hardware(self):
pass

View File

@ -223,6 +223,15 @@ class Tici(HardwareBase):
except Exception:
return None
def get_modem_temperatures(self):
modem = self.get_modem()
try:
command_timeout = 0.2
temps = modem.Command("AT+QTEMP", int(command_timeout * 1000), dbus_interface=MM_MODEM, timeout=command_timeout)
return list(map(int, temps.split(' ')[1].split(',')))
except Exception:
return []
# We don't have a battery, so let's use some sane constants
def get_battery_capacity(self):
return 100

View File

@ -69,6 +69,7 @@ def read_thermal(thermal_config):
dat.deviceState.gpuTempC = [read_tz(z) / thermal_config.gpu[1] for z in thermal_config.gpu[0]]
dat.deviceState.memoryTempC = read_tz(thermal_config.mem[0]) / thermal_config.mem[1]
dat.deviceState.ambientTempC = read_tz(thermal_config.ambient[0]) / thermal_config.ambient[1]
dat.deviceState.modemTempC = HARDWARE.get_modem_temperatures()
return dat