From 8f8f185a959e7fa04bc28996f594ca605c7bf7fb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Jan 2025 16:26:13 -0800 Subject: [PATCH] sensord: add new config (#34442) * sensord: add new config * fix mypy --- system/hardware/tici/hardware.py | 4 ++++ system/sensord/tests/test_sensord.py | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/system/hardware/tici/hardware.py b/system/hardware/tici/hardware.py index 3409888b9d..dd3f36963c 100644 --- a/system/hardware/tici/hardware.py +++ b/system/hardware/tici/hardware.py @@ -205,6 +205,8 @@ class Tici(HardwareBase): return str(self.get_modem().Get(MM_MODEM, 'EquipmentIdentifier', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)) def get_network_info(self): + if self.get_device_type() == "mici": + return None try: modem = self.get_modem() info = modem.Command("AT+QNWINFO", math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT) @@ -295,6 +297,8 @@ class Tici(HardwareBase): return None def get_modem_temperatures(self): + if self.get_device_type() == "mici": + return [] timeout = 0.2 # Default timeout is too short try: modem = self.get_modem() diff --git a/system/sensord/tests/test_sensord.py b/system/sensord/tests/test_sensord.py index 1871012dd6..15f1f2dc35 100644 --- a/system/sensord/tests/test_sensord.py +++ b/system/sensord/tests/test_sensord.py @@ -9,6 +9,7 @@ from cereal import log from cereal.services import SERVICE_LIST from openpilot.common.gpio import get_irqs_for_action from openpilot.common.timeout import Timeout +from openpilot.system.hardware import HARDWARE from openpilot.system.manager.process_config import managed_processes BMX = { @@ -29,12 +30,17 @@ MMC = { ('mmc5603nj', 'magneticUncalibrated'), } -SENSOR_CONFIGURATIONS = ( - (BMX | LSM), - (MMC | LSM), - (BMX | LSM_C), - (MMC| LSM_C), -) +SENSOR_CONFIGURATIONS: list[set] = [ + BMX | LSM, + MMC | LSM, + BMX | LSM_C, + MMC| LSM_C, +] +if HARDWARE.get_device_type() == "mici": + SENSOR_CONFIGURATIONS = [ + LSM, + LSM_C, + ] Sensor = log.SensorEventData.SensorSource SensorConfig = namedtuple('SensorConfig', ['type', 'sanity_min', 'sanity_max'])