|
10 | 10 | from modules.devices.good_we.good_we import counter
|
11 | 11 | from modules.devices.good_we.good_we import inverter
|
12 | 12 | from modules.devices.good_we.good_we.config import GoodWe, GoodWeBatSetup, GoodWeCounterSetup, GoodWeInverterSetup
|
| 13 | +from modules.devices.good_we.good_we.version import GoodWeVersion |
13 | 14 |
|
14 | 15 | log = logging.getLogger(__name__)
|
15 | 16 |
|
|
19 | 20 | def create_device(device_config: GoodWe):
|
20 | 21 | def create_bat_component(component_config: GoodWeBatSetup):
|
21 | 22 | return bat.GoodWeBat(device_config.configuration.modbus_id,
|
22 |
| - device_config.configuration.version, device_config.configuration.firmware, |
| 23 | + GoodWeVersion(device_config.configuration.version), |
| 24 | + device_config.configuration.firmware, |
23 | 25 | component_config, client)
|
24 | 26 |
|
25 | 27 | def create_counter_component(component_config: GoodWeCounterSetup):
|
26 | 28 | return counter.GoodWeCounter(device_config.id, device_config.configuration.modbus_id,
|
27 |
| - device_config.configuration.version, device_config.configuration.firmware, |
| 29 | + GoodWeVersion(device_config.configuration.version), |
| 30 | + device_config.configuration.firmware, |
28 | 31 | component_config, client)
|
29 | 32 |
|
30 | 33 | def create_inverter_component(component_config: GoodWeInverterSetup):
|
31 | 34 | return inverter.GoodWeInverter(device_config.configuration.modbus_id,
|
32 |
| - device_config.configuration.version, device_config.configuration.firmware, |
| 35 | + GoodWeVersion(device_config.configuration.version), |
| 36 | + device_config.configuration.firmware, |
33 | 37 | component_config, client)
|
34 | 38 |
|
35 | 39 | def update_components(components: Iterable[good_we_component_classes]):
|
|
0 commit comments