Example #1
0
 def __init__(self, device_id: int, component_config: Union[Dict, LgBatSetup]) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(LgBatSetup, component_config)
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.__simulation = {}
     self.__store = get_bat_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(self.component_config)
Example #2
0
 def __init__(self, device_id: int, component_config: dict,
              tcp_client: modbus.ModbusClient) -> None:
     self.component_config = component_config
     self.__tcp_client = tcp_client
     self.__store = get_counter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #3
0
 def __init__(self, device_id: int, device_address: str,
              component_config: dict) -> None:
     self.__device_address = device_address
     self.component_config = component_config
     self.__store = get_inverter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #4
0
 def __init__(self, component_config: Union[Dict,
                                            TeslaInverterSetup]) -> None:
     self.component_config = dataclass_from_dict(TeslaInverterSetup,
                                                 component_config)
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #5
0
 def __init__(self, device_id: int, component_config: dict) -> None:
     self.__device_id = device_id
     self.component_config = component_config
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_counter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(component_config)
Example #6
0
 def __init__(self, device_id: int, component_config: dict, tcp_client: modbus.ModbusClient) -> None:
     self.component_config = component_config
     factory = kit_counter_inverter_version_factory(
         component_config["configuration"]["version"])
     self.__client = factory(component_config["configuration"]["id"], tcp_client)
     self.__tcp_client = tcp_client
     self.__store = get_inverter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(component_config)
Example #7
0
 def __init__(self, component_config: Union[Dict, StuderInverterSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.component_config = dataclass_from_dict(StuderInverterSetup,
                                                 component_config)
     self.__tcp_client = tcp_client
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #8
0
 def __init__(self, component_config: Union[Dict, SmaSunnyIslandBatSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.component_config = dataclass_from_dict(SmaSunnyIslandBatSetup,
                                                 component_config)
     self.__tcp_client = tcp_client
     self.__store = get_bat_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #9
0
 def __init__(self,
              value_store_factory: Callable[[int], ValueStore[T]],
              parser: Callable[[dict], T],
              component_config: Union[SmaHomeManagerCounterSetup, SmaHomeManagerInverterSetup]):
     self.__value_store = value_store_factory(component_config.id)
     self.__parser = parser
     self.__serial_matcher = _create_serial_matcher(component_config.configuration.serials)
     self.component_info = ComponentInfo.from_component_config(component_config)
Example #10
0
 def __init__(self,
              device_id: int,
              component_config: Union[Dict, KostalPikoInverterSetup],
              ip_address: str) -> None:
     self.component_config = dataclass_from_dict(KostalPikoInverterSetup, component_config)
     self.ip_address = ip_address
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(self.component_config)
Example #11
0
 def __init__(self, value_store_factory: Callable[[int], ValueStore[T]],
              parser: Callable[[dict], T], component_config: dict):
     self.__value_store = value_store_factory(component_config["id"])
     self.__parser = parser
     self.__serial_matcher = _create_serial_matcher(
         component_config["configuration"]["serials"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #12
0
 def __init__(self, component_config: dict, ip_address: str,
              password: str) -> None:
     self.component_config = component_config
     self.ip_address = ip_address
     self.password = password
     self.__store = get_inverter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #13
0
 def __init__(self, device_id: int, component_config: dict) -> None:
     self.__device_id = device_id
     self.component_config = component_config
     ip_address = component_config["configuration"]["ip_address"]
     self.__tcp_client = modbus.ModbusClient(ip_address, 502)
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.__simulation = {}
     self.__store = get_bat_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(component_config)
Example #14
0
 def __init__(
         self, device_address: str,
         component_config: Union[Dict, SmaWebboxInverterSetup]) -> None:
     self.__device_address = device_address
     self.component_config = dataclass_from_dict(SmaWebboxInverterSetup,
                                                 component_config)
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #15
0
 def __init__(self, device_id: int,
              component_config: Union[Dict, SolaredgeCounterSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.component_config = dataclass_from_dict(SolaredgeCounterSetup,
                                                 component_config)
     self.__tcp_client = tcp_client
     self.__store = get_counter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #16
0
 def __init__(self,
              modbus_id: int,
              component_config: Union[Dict, GoodWeBatSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.__modbus_id = modbus_id
     self.component_config = dataclass_from_dict(GoodWeBatSetup, component_config)
     self.__tcp_client = tcp_client
     self.__store = get_bat_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(self.component_config)
Example #17
0
 def __init__(self, component_config: dict, domain: str) -> None:
     self.__get_power = create_request_function(
         domain, component_config["configuration"]["power_path"])
     self.__get_counter = create_request_function(
         domain, component_config["configuration"]["counter_path"])
     self.component_config = component_config
     self.__store = get_inverter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #18
0
    def __init__(self, component_config: Union[Dict, SunwaysInverterSetup],
                 ip_address: str, password: str) -> None:

        self.component_config = dataclass_from_dict(SunwaysInverterSetup,
                                                    component_config)
        self.ip_address = ip_address
        self.password = password
        self.__store = get_inverter_value_store(self.component_config.id)
        self.component_info = ComponentInfo.from_component_config(
            self.component_config)
Example #19
0
File: bat.py Project: okaegi/openWB
 def __init__(self, device_id: int, component_config: dict,
              tcp_client: modbus.ModbusClient, device_config: Dict) -> None:
     self.__device_id = device_id
     self.component_config = component_config
     self.__tcp_client = tcp_client
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.__simulation = {}
     self.__store = get_bat_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #20
0
 def __init__(self,
              device_id: int,
              component_config: Union[Dict, SungrowCounterSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(SungrowCounterSetup, component_config)
     self.__tcp_client = tcp_client
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_counter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(self.component_config)
Example #21
0
 def __init__(self, device_id: int,
              component_config: Union[Dict, FroniusInverterSetup],
              device_config: FroniusConfiguration) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(FroniusInverterSetup,
                                                 component_config)
     self.device_config = device_config
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #22
0
 def __init__(self, device_id: int,
              component_config: Union[Dict, KostalPikoCounterSetup],
              ip_address: str) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(KostalPikoCounterSetup,
                                                 component_config)
     self.ip_address = ip_address
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_counter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #23
0
 def __init__(
         self, device_id: int, device_address: str, device_variant: int,
         component_config: Union[Dict, SonnenbatterieBatSetup]) -> None:
     self.__device_id = device_id
     self.__device_address = device_address
     self.__device_variant = device_variant
     self.component_config = dataclass_from_dict(SonnenbatterieBatSetup,
                                                 component_config)
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_bat_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #24
0
 def __init__(self, device_id: int,
              component_config: Union[Dict,
                                      HttpInverterSetup], url: str) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(HttpInverterSetup,
                                                 component_config)
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_inverter_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
     self.__get_power = create_request_function(
         url, self.component_config.configuration.power_path)
     self.__get_exported = create_request_function(
         url, self.component_config.configuration.exported_path)
Example #25
0
 def __init__(self, device_id: int,
              component_config: Union[Dict, BatKitFlexSetup],
              tcp_client: modbus.ModbusTcpClient_) -> None:
     self.__device_id = device_id
     self.component_config = dataclass_from_dict(BatKitFlexSetup,
                                                 component_config)
     factory = kit_bat_version_factory(
         self.component_config.configuration.version)
     self.__client = factory(self.component_config.configuration.id,
                             tcp_client)
     self.__tcp_client = tcp_client
     self.__sim_count = simcount.SimCountFactory().get_sim_counter()()
     self.simulation = {}
     self.__store = get_bat_value_store(self.component_config.id)
     self.component_info = ComponentInfo.from_component_config(
         self.component_config)
Example #26
0
    def __init__(self, component_config: dict, domain: str) -> None:
        self.__get_power = create_request_function(
            domain, component_config["configuration"]["power_path"])
        self.__get_imported = create_request_function(
            domain, component_config["configuration"]["imported_path"])
        self.__get_exported = create_request_function(
            domain, component_config["configuration"]["exported_path"])
        self.__get_powers = [
            create_request_function(
                domain, component_config["configuration"]["power_l" + str(i) +
                                                          "_path"])
            for i in range(1, 4)
        ]

        self.component_config = component_config
        self.__store = get_counter_value_store(component_config["id"])
        self.component_info = ComponentInfo.from_component_config(
            component_config)
Example #27
0
 def __init__(self, component_config: dict,
              persister: Callable[[CounterState], None]):
     self.__meter_id = component_config["configuration"]["meter_id"]
     self.__persister = persister
     self.component_info = ComponentInfo.from_component_config(
         component_config)
Example #28
0
 def __init__(self, device_address: str, component_config: dict) -> None:
     self.component_config = component_config
     self.__tcp_client = modbus.ModbusClient(device_address)
     self.__store = get_inverter_value_store(component_config["id"])
     self.component_info = ComponentInfo.from_component_config(component_config)