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
parent
02825585fb
commit
6117c7ce81
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue