mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 18:53:55 +08:00
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>
old-commit-hash: 6117c7ce81
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user