diff --git a/packages/helpermodules/constants.py b/packages/helpermodules/constants.py index e493371fd5..c364a8a948 100644 --- a/packages/helpermodules/constants.py +++ b/packages/helpermodules/constants.py @@ -9,6 +9,7 @@ class DEFAULT_COLORS(Enum): CHARGEPOINT = "#007bff" + CONSUMER = "#9C65FF" VEHICLE = "#17a2b8" INVERTER = "#28a745" COUNTER = "#dc3545" diff --git a/packages/helpermodules/measurement_logging/conftest.py b/packages/helpermodules/measurement_logging/conftest.py index 950222bfd1..43c64d4f3d 100644 --- a/packages/helpermodules/measurement_logging/conftest.py +++ b/packages/helpermodules/measurement_logging/conftest.py @@ -6,12 +6,18 @@ from control.chargepoint.chargepoint_all import AllChargepoints from control import bat_all, counter, pv_all, pv from control import data +from control.consumer.consumer import Consumer +from control.consumer.consumer_all import AllConsumers +from modules.consumers.generic.mqtt.config import Mqtt @pytest.fixture(autouse=True) def data_module() -> None: data.data_init(Event()) data.data.bat_data.update({"all": bat_all.BatAll(), "bat2": Bat(2)}) + data.data.consumer_all_data = AllConsumers() + data.data.consumer_data.update({"consumer6": Consumer(6)}) + data.data.consumer_data["consumer6"].data.module = Mqtt() data.data.counter_data.update({"counter0": counter.Counter(0)}) data.data.cp_all_data = AllChargepoints() data.data.cp_data.update({"cp4": chargepoint.Chargepoint( diff --git a/packages/helpermodules/measurement_logging/write_log.py b/packages/helpermodules/measurement_logging/write_log.py index beabf58b53..8d631b80db 100644 --- a/packages/helpermodules/measurement_logging/write_log.py +++ b/packages/helpermodules/measurement_logging/write_log.py @@ -380,7 +380,7 @@ def get_names(elements: Dict, sh_names: Dict, valid_names: Optional[Dict] = None """ names = sh_names for group in elements.items(): - if group[0] not in ("bat", "counter", "cp", "pv", "ev", "sh"): + if group[0] not in ("bat", "consumer", "counter", "cp", "pv", "ev", "sh"): continue for entry in group[1]: # valid_names wird aus update_config übergeben, da dort noch kein Zugriff auf data möglich ist @@ -396,6 +396,8 @@ def get_names(elements: Dict, sh_names: Dict, valid_names: Optional[Dict] = None try: if "ev" in entry: names.update({entry: data.data.ev_data[entry].data.name}) + elif "consumer" in entry: + names.update({entry: data.data.consumer_data[entry].data.module.name}) elif "cp" in entry: names.update({entry: data.data.cp_data[entry].data.config.name}) elif "all" != entry: @@ -416,13 +418,15 @@ def get_colors(elements: Dict) -> Dict: """ colors = {} for group in elements.items(): - if group[0] not in ("ev", "cp", "counter", "pv", "bat"): + if group[0] not in ("ev", "cp", "counter", "consumer", "pv", "bat"): continue for entry in group[1]: if "all" != entry: try: if "ev" in entry: colors.update({entry: data.data.ev_data[entry].data.color}) + elif "consumer" in entry: + colors.update({entry: data.data.consumer_data[entry].data.module.color}) elif "cp" in entry: colors.update({entry: data.data.cp_data[entry].data.config.color}) else: diff --git a/packages/helpermodules/measurement_logging/write_log_test.py b/packages/helpermodules/measurement_logging/write_log_test.py index a491716c85..11421bc76b 100644 --- a/packages/helpermodules/measurement_logging/write_log_test.py +++ b/packages/helpermodules/measurement_logging/write_log_test.py @@ -13,6 +13,7 @@ def test_get_names(daily_log_totals, monkeypatch): # evaluation assert names == {'bat2': "Speicher", + "consumer6": "MQTT-Verbraucher", 'counter0': "Zähler", 'cp3': "cp3", 'cp4': "neuer Ladepunkt", diff --git a/packages/modules/common/consumer_setup.py b/packages/modules/common/consumer_setup.py index 153c906e27..c5563b69fb 100644 --- a/packages/modules/common/consumer_setup.py +++ b/packages/modules/common/consumer_setup.py @@ -1,6 +1,7 @@ -from typing import Generic, List, TypeVar +from typing import Generic, Optional, TypeVar, Tuple from control.consumer.usage import ConsumerUsage +from helpermodules.constants import DEFAULT_COLORS T = TypeVar("T") @@ -13,7 +14,8 @@ def __init__(self, id: int, vendor: str, configuration: T, - usage: List[ConsumerUsage]) -> None: + usage: Tuple[ConsumerUsage, ...], + color: Optional[str] = None) -> None: self.name = name self.info = {"manufacturer": None, "model": None} self.type = type @@ -21,3 +23,7 @@ def __init__(self, self.configuration = configuration self.vendor = vendor self.usage = usage + if color: + self.color = color + else: + self.color = DEFAULT_COLORS.CONSUMER.value diff --git a/packages/modules/consumers/askoma/askoheat/config.py b/packages/modules/consumers/askoma/askoheat/config.py index 5669b2b194..1c52a288e8 100644 --- a/packages/modules/consumers/askoma/askoheat/config.py +++ b/packages/modules/consumers/askoma/askoheat/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -24,7 +24,8 @@ def __init__(self, type: str = "askoheat", id: int = 0, configuration: AskoheatConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or AskoheatConfiguration(), usage=usage) + ).type, configuration=configuration or AskoheatConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/avm/avm/config.py b/packages/modules/consumers/avm/avm/config.py index c8d5407d83..40c6998564 100644 --- a/packages/modules/consumers/avm/avm/config.py +++ b/packages/modules/consumers/avm/avm/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -30,7 +30,8 @@ def __init__(self, type: str = "avm", id: int = 0, configuration: AvmConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or AvmConfiguration(), usage=usage) + ).type, configuration=configuration or AvmConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/generic/dac/config.py b/packages/modules/consumers/generic/dac/config.py index 7ab286282a..ac9e34cd40 100644 --- a/packages/modules/consumers/generic/dac/config.py +++ b/packages/modules/consumers/generic/dac/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -27,6 +27,7 @@ def __init__(self, type: str = "dac", id: int = 0, configuration: DacConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or DacConfiguration(), usage=usage) + ).type, configuration=configuration or DacConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/generic/http/config.py b/packages/modules/consumers/generic/http/config.py index a35d62a217..6fe3eef212 100644 --- a/packages/modules/consumers/generic/http/config.py +++ b/packages/modules/consumers/generic/http/config.py @@ -1,4 +1,4 @@ -from typing import List +from typing import Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -40,9 +40,10 @@ def __init__(self, type: str = "http", id: int = 0, configuration: HttpConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY, - ConsumerUsage.CONTINUOUS, - ConsumerUsage.SUSPENDABLE_ONOFF, - ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY, + ConsumerUsage.CONTINUOUS, + ConsumerUsage.SUSPENDABLE_ONOFF, + ConsumerUsage.SUSPENDABLE_TUNABLE), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or HttpConfiguration(), usage=usage) + ).type, configuration=configuration or HttpConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/generic/json/config.py b/packages/modules/consumers/generic/json/config.py index feb0f1ce18..fda50af220 100644 --- a/packages/modules/consumers/generic/json/config.py +++ b/packages/modules/consumers/generic/json/config.py @@ -1,4 +1,4 @@ -from typing import List +from typing import Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -40,9 +40,10 @@ def __init__(self, type: str = "json", id: int = 0, configuration: JsonConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY, - ConsumerUsage.CONTINUOUS, - ConsumerUsage.SUSPENDABLE_ONOFF, - ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY, + ConsumerUsage.CONTINUOUS, + ConsumerUsage.SUSPENDABLE_ONOFF, + ConsumerUsage.SUSPENDABLE_TUNABLE), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or JsonConfiguration(), usage=usage) + ).type, configuration=configuration or JsonConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/generic/mqtt/config.py b/packages/modules/consumers/generic/mqtt/config.py index 4986e3d5eb..b2ab560af1 100644 --- a/packages/modules/consumers/generic/mqtt/config.py +++ b/packages/modules/consumers/generic/mqtt/config.py @@ -1,4 +1,4 @@ -from typing import List +from typing import Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -19,9 +19,10 @@ def __init__(self, type: str = "mqtt", id: int = 0, configuration: MqttConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY, - ConsumerUsage.CONTINUOUS, - ConsumerUsage.SUSPENDABLE_ONOFF, - ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY, + ConsumerUsage.CONTINUOUS, + ConsumerUsage.SUSPENDABLE_ONOFF, + ConsumerUsage.SUSPENDABLE_TUNABLE), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or MqttConfiguration(), usage=usage) + ).type, configuration=configuration or MqttConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/idm/idm/config.py b/packages/modules/consumers/idm/idm/config.py index 2d10083600..baf3c7bcc0 100644 --- a/packages/modules/consumers/idm/idm/config.py +++ b/packages/modules/consumers/idm/idm/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -26,7 +26,8 @@ def __init__(self, type: str = "idm", id: int = 0, configuration: IdmConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or IdmConfiguration(), usage=usage) + ).type, configuration=configuration or IdmConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/lambda_/lambda_/config.py b/packages/modules/consumers/lambda_/lambda_/config.py index 476639d569..f72ec12455 100644 --- a/packages/modules/consumers/lambda_/lambda_/config.py +++ b/packages/modules/consumers/lambda_/lambda_/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -26,7 +26,8 @@ def __init__(self, type: str = "lambda", id: int = 0, configuration: LambdaConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or LambdaConfiguration(), usage=usage) + ).type, configuration=configuration or LambdaConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/my_pv/acthor/config.py b/packages/modules/consumers/my_pv/acthor/config.py index 2429eccc4c..2e8f785058 100644 --- a/packages/modules/consumers/my_pv/acthor/config.py +++ b/packages/modules/consumers/my_pv/acthor/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -28,7 +28,8 @@ def __init__(self, type: str = "acthor", id: int = 0, configuration: ActhorConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or ActhorConfiguration(), usage=usage) + ).type, configuration=configuration or ActhorConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/my_pv/elwa_e/config.py b/packages/modules/consumers/my_pv/elwa_e/config.py index c5f1e7e1fc..c41b65881f 100644 --- a/packages/modules/consumers/my_pv/elwa_e/config.py +++ b/packages/modules/consumers/my_pv/elwa_e/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -24,7 +24,8 @@ def __init__(self, type: str = "elwa_e", id: int = 0, configuration: ElwaConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or ElwaConfiguration(), usage=usage) + ).type, configuration=configuration or ElwaConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/mystrom/mystrom/config.py b/packages/modules/consumers/mystrom/mystrom/config.py index 642b7d8b55..3532dff044 100644 --- a/packages/modules/consumers/mystrom/mystrom/config.py +++ b/packages/modules/consumers/mystrom/mystrom/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -19,7 +19,8 @@ def __init__(self, type: str = "mystrom", id: int = 0, configuration: MyStromConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_ONOFF, - ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_ONOFF, + ConsumerUsage.METER_ONLY), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or MyStromConfiguration(), usage=usage) + ).type, configuration=configuration or MyStromConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/nibe/nibe_s_series/config.py b/packages/modules/consumers/nibe/nibe_s_series/config.py index dc1da37b8f..5168d0de78 100644 --- a/packages/modules/consumers/nibe/nibe_s_series/config.py +++ b/packages/modules/consumers/nibe/nibe_s_series/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -22,6 +22,7 @@ def __init__(self, type: str = "nibe_s_series", id: int = 0, configuration: NibeConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or NibeConfiguration(), usage=usage) + ).type, configuration=configuration or NibeConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/ratiotherm/ratiotherm/config.py b/packages/modules/consumers/ratiotherm/ratiotherm/config.py index 6167b5d300..4c325d0500 100644 --- a/packages/modules/consumers/ratiotherm/ratiotherm/config.py +++ b/packages/modules/consumers/ratiotherm/ratiotherm/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -24,6 +24,7 @@ def __init__(self, type: str = "ratiotherm", id: int = 0, configuration: RatiothermConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_TUNABLE]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_TUNABLE,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or RatiothermConfiguration(), usage=usage) + ).type, configuration=configuration or RatiothermConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/shelly/shelly_em/config.py b/packages/modules/consumers/shelly/shelly_em/config.py index e01b5f6b0c..2d3169acfa 100644 --- a/packages/modules/consumers/shelly/shelly_em/config.py +++ b/packages/modules/consumers/shelly/shelly_em/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -28,6 +28,7 @@ def __init__(self, type: str = "shelly_em", id: int = 0, configuration: ShellyConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or ShellyConfiguration(), usage=usage) + ).type, configuration=configuration or ShellyConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/shelly/shelly_pm/config.py b/packages/modules/consumers/shelly/shelly_pm/config.py index 4f28d0c1f7..d0676e9a84 100644 --- a/packages/modules/consumers/shelly/shelly_pm/config.py +++ b/packages/modules/consumers/shelly/shelly_pm/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -30,7 +30,8 @@ def __init__(self, type: str = "shelly_pm", id: int = 0, configuration: ShellyConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY, - ConsumerUsage.SUSPENDABLE_ONOFF]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY, + ConsumerUsage.SUSPENDABLE_ONOFF), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or ShellyConfiguration(), usage=usage) + ).type, configuration=configuration or ShellyConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/solvis/solvis/config.py b/packages/modules/consumers/solvis/solvis/config.py index e51fd7156e..564832c8da 100644 --- a/packages/modules/consumers/solvis/solvis/config.py +++ b/packages/modules/consumers/solvis/solvis/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -21,6 +21,7 @@ def __init__(self, type: str = "solvis", id: int = 0, configuration: SolvisConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.METER_ONLY]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.METER_ONLY,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or SolvisConfiguration(), usage=usage) + ).type, configuration=configuration or SolvisConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/stiebel/stiebel/config.py b/packages/modules/consumers/stiebel/stiebel/config.py index 17e629b03b..aa940eef11 100644 --- a/packages/modules/consumers/stiebel/stiebel/config.py +++ b/packages/modules/consumers/stiebel/stiebel/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -24,6 +24,7 @@ def __init__(self, type: str = "stiebel", id: int = 0, configuration: StiebelConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_ONOFF]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_ONOFF,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or StiebelConfiguration(), usage=usage) + ).type, configuration=configuration or StiebelConfiguration(), usage=usage, **kwargs) diff --git a/packages/modules/consumers/viessmann/viessmann_heat_pump/config.py b/packages/modules/consumers/viessmann/viessmann_heat_pump/config.py index ddc8be0fd0..6274b60698 100644 --- a/packages/modules/consumers/viessmann/viessmann_heat_pump/config.py +++ b/packages/modules/consumers/viessmann/viessmann_heat_pump/config.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import Optional, Tuple from control.consumer.consumer_data import ConsumerUsage from helpermodules.auto_str import auto_str @@ -21,6 +21,7 @@ def __init__(self, type: str = "viessmann_heat_pump", id: int = 0, configuration: ViessmannConfiguration = None, - usage: List[ConsumerUsage] = [ConsumerUsage.SUSPENDABLE_ONOFF]) -> None: + usage: Tuple[ConsumerUsage, ...] = (ConsumerUsage.SUSPENDABLE_ONOFF,), + **kwargs) -> None: super().__init__(name, type, id, vendor=vendor_descriptor.configuration_factory( - ).type, configuration=configuration or ViessmannConfiguration(), usage=usage) + ).type, configuration=configuration or ViessmannConfiguration(), usage=usage, **kwargs)