From 5b4142889894d30f77f9d9339f24c2e6526f508e Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Wed, 20 Sep 2023 13:53:01 +0200 Subject: [PATCH] fix soc interval config --- packages/modules/common/configurable_vehicle.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/modules/common/configurable_vehicle.py b/packages/modules/common/configurable_vehicle.py index 772adc9f71..636dd2470e 100644 --- a/packages/modules/common/configurable_vehicle.py +++ b/packages/modules/common/configurable_vehicle.py @@ -1,4 +1,4 @@ -from typing import TypeVar, Generic, Callable +from typing import Optional, TypeVar, Generic, Callable from modules.common import store from modules.common.abstract_soc import SocUpdateData @@ -24,10 +24,13 @@ def __init__(self, vehicle_config: T_VEHICLE_CONFIG, component_updater: Callable[[T_VEHICLE_CONFIG, SocUpdateData], CarState], vehicle: int, - interval_config: IntervalConfig = IntervalConfig()) -> None: + interval_config: Optional[IntervalConfig] = None) -> None: self.__component_updater = component_updater self.vehicle_config = vehicle_config - self.interval_config = interval_config + if interval_config is None: + self.interval_config = IntervalConfig() + else: + self.interval_config = interval_config self.vehicle = vehicle self.store = store.get_car_value_store(self.vehicle) self.component_info = ComponentInfo(self.vehicle, self.vehicle_config.name, "vehicle")